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


in reply to untainting regex input

You might use Regexp::English /PPIx::Regexp / Regexp::Debugger, see links and content in Re: Wanted: Perl Regex Pretty Printer (almost, rxrx, rxplain)

Reject anything with errors, remove code nodes, escape literals ... insert callback/for recursion/backtracking/ abortion

Or allow only limited subset to be built ... insert callback for recursion /backtracking detection/abortion