How to combine accented characters in preg_match ()?

I read how accented characters can sometimes match [az] . I would like to know how I could fit a particular accented character. Obviously, preg_match('/[Γ±]/', 'Γ±') does not work.

+6
php regex special-characters
source share
2 answers

Use the / u modifier. This will allow you to use Unicode for regular expressions. http://php.net/manual/en/reference.pcre.pattern.modifiers.php

+16
source share

You can take their codes and match them as \ xD0 - hexadecimal sequences if accented characters are not accepted

+4
source share

All Articles