Answer the question
In order to leave comments, you need to log in
How to choose a word so that it is not between other words?
I need to replace all expressions of the word "If" except when it is inside a word.
IfOtherwise - we do not replace
SomethingIfNotThat - we do not replace
And these we replace
If Not
If;
(If)
If=
=If
etc.
I can't figure out the regular expression.
Everything seems to be simple, but for example this [^A-z] If [^A-z] captures spaces and the service characters themselves, but only the word is needed, everything else should remain in its place.
Answer the question
In order to leave comments, you need to log in
Something like this, but it's like this:(?<=[^А-яёЁ]|^)Если(?=[^А-яёЁ]|$)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question