http://www.perlmonks.org?node_id=185993

PetaMem has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks,

I wonder if there is a way to validate a regexp in Perl. It'd need just a YES/NO functionality. Let's say you have something like a[hjg].* and *a[hj. The routine (my guess is that this could even be another regexp), should identify the first regexp as valid, the second as invalid.

I've been peeking around in the monastery, but only found references to the much bigger (if not impossible) task of validating perl code. But it seems to me, that a plain YES/NO regexp validation should be feasible.

Any clues? TIA

Bye
 PetaMem