This is a duplicate of my answer to Parse::RandGen::Regexp

As the qr// method runs in interpolative context one can do

use strict; my $match='test'; my $regex_match=qr/$match/i; my $test_value='This is a Test'; print 'It matches' if $test_value=~m/$regex_match/;

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law


In reply to Re^3: Reverse engineering regular expressions by CountZero
in thread Reverse engineering regular expressions by paulski

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":