I don't immediately have the means of converting a Perl regexp pattern into a JavaScript regexp pattern, but I got you half way there by answering your question. "[a-z].*?[0-9] $" would not be equivalent to the compiled regexp.
If you're dealing with the subset that's compatible to both, why don't you just keep the pattern and the compiled regexp separately?
my %regexps = map { $_ => qr/$_/ } @regexps;
In reply to Re^3: Can qr be un-compiled?
by ikegami
in thread Can qr be un-compiled?
by cosmicperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |