Depending on how nasty your users are, allowing arbitrary regular expressions is an unwise choice. The following regex is valid but will use up lots of CPU:
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaa" =~ /a*a*a*b/
If you can come up with a whitelist of allowed regexes, that would improve things, or maybe consider running the regex search as a time-limited subprocess.
In reply to Re: Is it safe to use external strings for regexes?
by Corion
in thread Is it safe to use external strings for regexes?
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |