Simple compiled regexp not working
- From: usenet@xxxxxxxxxxxxxxx
- Date: 30 Aug 2006 17:40:51 -0700
Kindly consider the following code which illustrates my question:
#!/usr/bin/perl
use strict; use warnings;
my $line = '08/29/2006 to 08/30/2006';
my $date_rx = qr{m!\d{2}/\d{2}/\d{4}!};
print "regexp matches\n" if $line =~ m!\d{2}/\d{2}/\d{4}!;
print "date_rx matches\n" if $line =~ /$date_rx/;
__END__
The way I read perlop, both print statements should fire, as they
should be doing the exact same match. But I only see the first one.
grrr. This ought to be really simple.
--
David Filmer (http://DavidFilmer.com)
.
- Follow-Ups:
- Re: Simple compiled regexp not working
- From: Uri Guttman
- Re: Simple compiled regexp not working
- Prev by Date: Re: Close a Running Sub-Process
- Next by Date: Re: Simple compiled regexp not working
- Previous by thread: Close a Running Sub-Process
- Next by thread: Re: Simple compiled regexp not working
- Index(es):
Relevant Pages
|