in reply to Re: searching a string with variable data
in thread searching a string with variable data
or, if you need to know the number, note the parens around the \d:
my $count; if (($count) = /see the (\d) brown foxes/) { print("There are $count foxes. Let's go hunting!$/"); }
Also, use \d+ if you want to match one or more digits, instead of just one.
|
|---|