I essentially wish to match every line that DOES NOT contain this string "Hello"
Example:
sdfsdoifdoskf
fdgokfdghodfkg
hello
fdojgohdfgjkdfg
gfobjobhkdfokgdfg
dofjkdsf hello dfgkdfogdfg
xcvmxhckvmxck
fogkdfhokg
hello
I attempted this Regex pattern : ^((?!hello).)*$
No matches found.
Basically i want to remove every line that does not contain the string "hello" using notepad++
Using Regex to find and replace text in Notepad++ In all examples, use select Find and Replace (Ctrl + H) to replace all the matches with the desired string or (no string). And also ensure the 'Regular expression' radio button is set.
invert-selection package Invert the current text selection. The default keymapping is ctrl-i.
The Regex. Replace(String, String, MatchEvaluator, RegexOptions) method is useful for replacing a regular expression match if any of the following conditions is true: If the replacement string cannot readily be specified by a regular expression replacement pattern.
Open the text file in Notepad++. In the top menu bar, click Search and select Replace. In the Replace window, on the Replace tab, enter the text you want to find and the text you want to use as a replacement. See our using search and replace and advanced options for further information and help.
^((?!hello).)*$
works in Notepad++ 6. I wonder if it's better than this: ^(?!.*hello).*$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With