I was going to put this in the Development section but I decided it was too small a fragment to be directly relevant to Bitcoin so I figured I'd post here instead.
I'm trying to get a unicode regular expression working but I think it might not be working properly.
Currently I'm testing with:
$pattern = '/[\p{L}]*$/';
$check = preg_match($pattern, 'Testing èggs');
if ($check) {
echo 'matched';
} else {
echo 'no match';
}
?>
This matches fine but as soon as I change the $pattern to:
$pattern = '/^[\p{L}]*$/'
It stops working.
My understanding is that the ^ at the start of the pattern means to search from the start.
If so, why does it stop working? It works so long as it's not multi language, e.g. using the \w shorthand.
Is my understanding wrong or is this not working on my PC?