Answer the question
In order to leave comments, you need to log in
How to make this regular expression find matches not one by one, but the whole block at once (On the service for checking regular expressions, this is true, but not in php)?
Hello! Here is this line: preg_replace('/[ \t]{1,}/m', 'z', $string);
If you take a regular expression and check it on some online service for checking regular expressions, then it finds the entire block at once. And in php, each whitespace character is replaced by the letter z one by one. The result is a lot of letters z. And there should have been one. How do I get a single letter z instead of all whitespace characters together?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question