Skip to content

Instantly share code, notes, and snippets.

@beatak
Created May 8, 2014 01:43
Show Gist options
  • Save beatak/5f749af678311d8100e5 to your computer and use it in GitHub Desktop.
Save beatak/5f749af678311d8100e5 to your computer and use it in GitHub Desktop.
$str = "あAいうえおaかAきくけこaさAしすせそ";
$pattern = "a";
mb_ereg_search_init($str, $pattern, "i");
while (mb_ereg_search()) {
print_r( [mb_ereg_search_getpos(), mb_ereg_search_getregs()] );
}
@beatak
Copy link
Author

beatak commented May 8, 2014

options for mb_ereg_* are all defined in
http://us3.php.net/manual/en/function.mb-regex-set-options.php.

not sure why the syntax is super different from other regex functions…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment