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).
In reply to Re: why this regular expression is so slow?
by JavaFan
in thread why this regular expression is so slow?
by fnever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |