Possible Duplicate:
Sanitization of User-Supplied Regular Expressions in PHP
Let's say you want to let users search for something and your search function has the ability to accept regular expressions.
Is it OK to let site users to search by regexes that they post? From a user's point of view, I'd love a site which would let me do that :D
Is there any security risk involved? How can I sanitize a regex?