or with capturing (like ikegami pointed out)if ( /see the \d brown foxes\. they are \w+ fast\./ ) { # do something }
my ($count, $word); if (($count, $word) = /see the (\d) brown foxes\. they are (\w+) fast\ +./) { print("There are $count foxes. Let's go hunting!$/"); }
In reply to Re^2: searching a string with variable data
by chb
in thread searching a string with variable data
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |