2
実際にutf-8を適切にサポートするために、コンポーネントの機能を再実装しようとしました。グローバル(反復)マッチを実行することは可能ですか?(デフォルトではpreg_matchではg修飾子ですか?)mb_ereg_matchでグローバル/反復検索を実行する
$pattern = 'du\@de\.com';
$whitespacedDude = ' du \@ de\. com ';
$globalDude = 'a global [email protected]';
$dude = '[email protected]';
var_dump(preg_match("/$pattern/", $globalDude, $matches));
var_dump(preg_match("/$whitespacedDude/x", $dude, $matches));
var_dump(mb_ereg_match("$pattern", $globalDude));
var_dump(mb_ereg_match("$whitespacedDude", $dude, 'x'));
与える:
true
true
false // this one should be true
true
実際にグローバル照合をシミュレートするmb_ereg_search
経由での回避策をやってイム。別の/より良い方法がありますか?
ありがとうございます。
アーク...;)ありがとう! – RCKY