in reply to Perl & Regex
Seems to work for me. I ran the following code, and I get the result of match. Is there anything else in your code?
#!/usr/bin/perl use strict; use warnings; my $searchstring = 'Price: \$([0-9]+\.[0-9]+)'; $_ = 'This is a test. Price: $1.30'; if( /$searchstring/ ) { print "match\n"; } __END__ match
By the way, you can also set up the regex using the qr operator, like:
Wish I could help more,my $searchString = qr/Price: \$([0-9]+\.[0-9]+)/;
|
|---|