In Notepad++, you might have a requirement to find or replace lines which do NOT match a particular string.
Lets say you have the following lines in your text file - and you would like to the find lines NOT containing the string "USA"Apple - USA
Airbus - France
Google -USA
IBM - USA
SAP - Germany
TESCO - UK
For this, you will have to use the Notepad++ Regex find option
Here's how:
- Press Ctrl + F to pop open the Find dialog box
- Select the Regular Expression radio button
- Type in the find box :
^(?!.*USA).*$
- Now find or replace.
- Mastering Regular Expressions - by Jeffrey Friedl ( Amazon.com | Amazon.in )
- Regular Expressions Cookbook by Jan Goyvaerts, Steve Levithan ( Amazon.com | Amazon.in)
Here's a screenshot of my notepad++ screen.
Không có nhận xét nào:
Đăng nhận xét