That doesn't print '2001', because it's trying to match \\d\{4\} instead of \d{4}$reg_exp = '\d{4}'; $string = 'The year is 2001, the month is April.'; $req_exp = quotemeta $req_exp; $string =~ /($req_exp)/; print $1;
cLive ;-)
In reply to Re: Re: Checking user input on dynamic regular expressions
by cLive ;-)
in thread Checking user input on dynamic regular expressions
by cLive ;-)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |