I'm writing a simple text search CGI script. The user types in a search term, and I perl grep through a datastructure of the text and return data.
At the moment I untaint the user input by allowing only "word like" characters and such. However, I'd like to allow the users to use regular expressions in their searches. However, I am not enough of a regex master to know what to allow/disallow. I've been told that you can execute code in a regex, so that makes me nervous about accepting any regex.
Is there a tool or any hints as to how I could safely allow this? Any input would be greatly appreciated!
rasto
In reply to untainting regex input by rastoboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |