I have preg_match_all(\'/[aäeëioöuáéíóú]/u\', $in, $out, PREG_OFFSET_CAPTURE);
If $in = \'hëllo\'
$out
is:
arr
PHP doesn't support unicode very well, so a lot of string functions, including preg_*, still count bytes instead of characters.
I tried finding a solution by encoding and decoding strings, but ultimately it all came down to the preg_match_all function.
About the python thing: a python regex matchobject contains the match position by default mo.start() and mo.end(). See: http://docs.python.org/library/re.html#finding-all-adverbs-and-their-positions