A few suggestions to improve the performance of regular expressions
Why is regular expression efficiency important? While well-written regular expressions can be very effective, poorly written regular expressions can take a long time to run and can significantly slow down a system. It is quite possible to write a regular expression that takes hours or days to complete, and it is even possible to write a regular expression that will not complete within the lifetime of the universe because it runs against a medium-sized string.