Craig Small schrob: > I'm thinking of adding a quick and dirty check for a regex. A very quick > set of characters to say "this is a regex" and suppress the warning. > The first idea is just look for a '[' or a '|'. I think that covers most > simple conditions. I'm not looking for some sort odd corner cases, just the > main ones.
I agree. | and [ should catch the vast majority of regexes already, and you'll always be able to add [] around a literal char just to disable the warning in the remaining cases. > I'm not even going to bother with checking if the regex is too long (e.g. > somethingverylonghere|somethingelsethatisverylong) because this is a simple > check. Yes, you'd go mad trying to figure out things like something(verylonghere|elsethatislong) anyway. Better to just assume that people writing regexes know (or test) what they're matching. cheers, Jan
signature.asc
Description: PGP signature