This means that you know when you're in the verbatim area since you'll have to know when to switch the regex object. With this knowledge block out the "comment found" part of your code when you're in the verbatim environment. The implementation is up to your imagination. ----- Original message ----- From: "Dan Drake" <dan at dandrake.org> To: "tclug-list at mn-linux.org" <tclug-list at mn-linux.org> Date: Fri, 12 Jan 2007 14:26:15 -0600 Subject: [tclug-list] regular expression that never matches? I'm looking for a regular expression that's guaranteed to never match anything. I'm working with a Python script that parses LaTeX documents [1], and I'm using a regexp to find comments (beginning of line, any whitespace, then a percent sign: "^\s*%"). But in the middle of the verbatim environment, it shouldn't interpret anything as comments -- so I'd like to use some sort of regexp that never matches, so I can just switch the particular regexp object I'm using while parsing such an environment. Any suggestions? I could randomly generate a bizarre string (like "\y;$j[3o*6I[/W~fq\+l|~yr~as") which in practical terms will work, but that's an ugly solution. TIA for the help. Dan 1. http://www.pps.jussieu.fr/~beffara/soft/rubber/ -- Ceci n'est pas une .signature.