Answer the question
In order to leave comments, you need to log in
How to write correct preg_replace pattern?
Let's say there is a string "Weather today - 26C"
Help me write the correct preg_match pattern to filter only text in the string , leaving only Latin letters and only, without letters and numbers.
Answer the question
In order to leave comments, you need to log in
preg_replace('#[^a-zа-я\s\./!?\\:]#iu', '', $s)
not easierpreg_match_all("#[0-9]+#", $string,$out);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question