Friday, 13 October 2017

regex - How to say in RegExp "contain this too"?





I need to check multiple regexp in one string. Is it possible to
check in one regexp? Here is important to find any order of
words.



For example I looking for "quick", "jump"
"lazy" in the string.



I can check it with
OR operator. It working with | (pipe)
character. But how can I change the OR to
AND ?



I can use this
with
OR:



/quick|jump|lazy/



But
I want to use something like
this:



/quick&jump&lazy/


Is
there any way?


itemprop="text">
class="normal">Answer




/(?=.*quick)(?=.*jump)(?=.*lazy)/
is what you're looking for I believe




No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...