in reply to why this regular expression is so slow?
The obvious answer here is: don't use a regexp. It seems you just want the last four characters in the string that aren't dashes or dots. You could simple remove the dashes and dots from the string, and take the last four characters from the resulting string. (You may need some special handling if the string may contain less than four such characters).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: why this regular expression is so slow?
by Corion (Patriarch) on Jul 15, 2009 at 09:44 UTC |