Click here to get back home

Simple compiled regexp not working

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Simple compiled regexp not working usenet 08-30-2006
Get Chitika Premium
Posted by usenet on August 30, 2006, 8:40 pm
Please log in for more thread options
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/\d/\d!};

print "regexp matches\n" if $line =~ m!\d/\d/\d!;
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)


Similar ThreadsPosted
Re: Simple compiled regexp not working August 30, 2006, 8:49 pm
simple regex not working September 13, 2008, 8:03 am
LWP::Simple getstore not working inside of hash :( January 3, 2005, 10:13 pm
Simple read directory script not working November 27, 2005, 1:04 pm
LWP::Simple getstore with absolute path not working June 14, 2008, 12:15 am
lwp::simple get (why it would stop working along with wget when fetch still works) July 17, 2007, 10:17 pm
lwp::simple get (why it would stop working along with wget when fetch still works) July 17, 2007, 10:17 pm
trouble with very simple regexp April 14, 2005, 3:22 pm
simple regexp problem March 1, 2006, 2:33 pm
Aaaagh! Simple RegExp Help Needed May 25, 2005, 8:46 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap