Edit: tchrist has informed me that my original accusations about Perl\'s insecurity are unfounded. However, the question still stands.
I know that i
AFAIK, you can do it safely in C#: you can supply the regex string to the Regex constructor, and if it fails to parse it'll throw. I'm not sure about others.