in reply to User configurable regex
with inputmy $re = <STDIN>; chomp ($re); my $line = <STDIN>; chomp ($line); print "$line =~ /$re/\n"; if ( $line =~ /$re/ ) { print "match"; } else { print "no match"; }
givesa\d3 a23
a23 =~ /a\d3/ match
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: User configurable regex
by MiggyMan (Sexton) on Oct 20, 2004 at 11:32 UTC | |
by Joost (Canon) on Oct 20, 2004 at 11:40 UTC | |
by MiggyMan (Sexton) on Oct 20, 2004 at 12:03 UTC |