Answer the question
In order to leave comments, you need to log in
How to exclude words containing a specific string?
There is such a regular expression:
/([Mm]ir[a-z]{1,3})/u
It will find 3 matches in the line: "World by world by worlds" and everything works, but in the line "World by world by worlds" it will find 4 matches, since the word "humble" fits the pattern, what should be added to it so that the word "humble" and the like do not fit the pattern?
Answer the question
In order to leave comments, you need to log in
Firstly, there is a case-insensitive search (flag i
), and secondly, a character \b
is a word boundary.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question