How to write regular expression with the given Cyrillic and Unicode?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
5 views
There is a regular expression:

$se = preg_replace('%[^A-Za-zА-Ha-H0-9]%', ", $se);

It cuts out all line characters, leaving only letters and numbers. You could rewrite it so that it worked on machines who do not know Cyrillic. To do this, if I understand correctly, the Cyrillic range should be written in the form hex-sequences (such as \\x0410), I can't find how to do it correctly.

Please help
by | 5 views

1 Answer

0 like 0 dislike
First you need to use the modifier u (if the file is in UTF-8 ranges "a-I" will work), and secondly you can use the notation \\p{xx}.
by

Related questions

0 like 0 dislike
5 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
27,979 users