Hello,
how I can search (using regular expressions) for lines, which do
not contain a given token.
For example, maybe I have several variables beginning int_var1.., int_var2.., ...Now I want to search all lines of the C-source, which do not contain int, something like [^(int)]_var.
Thanks for any hint!
Regards
Juergen
RegEx for searching all but a given token ?
Moderators: AmigoJack, bbadmin, helios, MudGuard
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
I think the easiest method is to Mark All with int_var and then toggle the Marked Lines.
Try this for your hint:
1. Search, Find, Mark All for the following:
^int_var
2. Close Find Window
3. Search, Invert All Bookmarks
Works with/without POSIX format
Hope this is helpful.................good luck,
Bob
Try this for your hint:
1. Search, Find, Mark All for the following:
^int_var
2. Close Find Window
3. Search, Invert All Bookmarks
Works with/without POSIX format
Hope this is helpful.................good luck,
Bob
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
Std answer is here. Also, I googled around a bit and found this and the main result there is
the same:
dogh! Bob beat me to it...
the same:
Using TP you can find all lines containing your string, bookmark those lines and then invert them.To see why it is impossible to constuct a regex that matches
anything but another regex you have to look at how regexs work in
terms of DFAs and all that - and then think on it for a few
hours
dogh! Bob beat me to it...