Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次の正規表現を作成しました
preg_match_all('#(autom(.*?)tic|(.*?)anual)#', $str2b, $gears);
ギリシャ文字に合わせて変更したい。βενζίνη言葉を 合わせたいのですが、πετρέλαιοうまくいきません。
βενζίνη
πετρέλαιο
preg_match_all('#(βενζί(.*?)η|πετρέλ(.*?)ιο)#', $str2b, $gears);
これどうやってするの?
/uUnicode マッチングには正規表現スイッチを使用する必要があります。
/u
preg_match_all('#(βενζί(.?)η|πετρέλ(.?)ιο)#u', $str2b, $gears);
ところで、\p{Greek}プロパティを使用してギリシャ文字を一致させることができます。
\p{Greek}