|
|
|
|
|
by stevek
5622 days ago
|
|
The single worst thing that people do wrong when writing regular expressions is to use .* x when really they should use [^x]* x (i.e. the common case of looking for some kind of terminator 'x') The worst case I ever saw had many .* running over some c++ source which would take several minutes per file. Presumably trying all combinations of backtracking. With the negated character class [^x] it was < .1 of a second. Edit: I see his twitter feed has .* as the icon. Ha! Edit2: My * are getting eaten by the formatter. There should be no space after them |
|