Page 1 of 1

putting comments into regex strings

PostPosted: Fri Jul 13, 2007 2:39 pm
by bobkoure
The regex engine NBP uses appears to understand regex comments just fine.
These look like (?#all this is a comment)
This might be useful if you keep a text file of useful regex strings as you can keep the "what it does" explanation right in the string itself - and, if you put this comment at the beginning of the line it will show up in the "past strings used" in the drop-down window - so for example:

(?#hide pdb and lib)^(?!.*pdb)(?!.*lib)

PostPosted: Fri Jul 13, 2007 7:01 pm
by Smite
Cool idea. Thanks.

PostPosted: Fri Sep 28, 2007 8:51 am
by bobkoure
Lately, I've been finding comments more useful in filters - lots easier to read a comment than re-figure-out what the filter does.