putting comments into regex strings
Posted: Fri Jul 13, 2007 2:39 pm
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)
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)