I know about x (?! Y) - finds x only if x is not followed by y. But I need to exclude the word regardless of where it stands.
Find the letter A but exclude such words: watermelon, abandon, etc.
I know about x (?! Y) - finds x only if x is not followed by y. But I need to exclude the word regardless of where it stands.
Find the letter A but exclude such words: watermelon, abandon, etc.
Regarding
Find the letter
Аbut exclude such words:арбуз,абандон, etc.
In Notepad ++, use the exciting alternate mask and the conditional replacement pattern:
(\b(?:арбуз|абандон)\w*)|а Replaced by
(?1$1:я) Those. using (\b(?:арбуз|абандон)\w*)|а we find and save all the exclusion words (with or without endings with \w* ) in group 1, and if they match, they will be restored in the text using ?1$1 (if the first submask is found, restore it), and the letter а will be changed / deleted in all other cases ( :я ).
Regarding the use of the Match case parameter, decide for yourself.
\w you can use \p{L} to find only Unicode letters. - Wiktor StribiżewCheck that the string does not contain the specified words:
/^((?!арбуз|абандон).)*$/i Select all the letters а that are not included in the given words:
s.match(/арбуз|абандон|а|$/gi).filter(m => m.length===1) match in match - Grundy$ he is guaranteed to find an empty string. Without it, on a string without letters would be null, which would .filter to .filter . And so we will definitely find something. - Qwertiy ♦Source: https://ru.stackoverflow.com/questions/538655/
All Articles
notepad++why is the javascript label worth it? - Grundy