in reply to YAREGEX for all
if ($fs =~ /^(?i)\/data\w+$/ || $fs =~ /^(?i)\/tmp\w+$/ ) {
The difference is the $fs after the ||. Your code compares the 2nd regex against $_.
If that doesn't do it, please show some examples of values of $fs.
Update: Here is a small example:
#!/usr/bin/env perl use warnings; use strict; while (my $fs = <DATA>) { if ($fs =~ /^(?i)\/data\w+$/ || $fs =~ /^(?i)\/tmp\w+$/ ) { print "match: $fs"; } } __DATA__ junk /tmp /tmpfoo /data /data2 /data again junk2
This prints:
match: /tmpfoo match: /data2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: YAREGEX for all
by mikejones (Scribe) on Apr 22, 2008 at 20:29 UTC | |
by chromatic (Archbishop) on Apr 22, 2008 at 20:34 UTC | |
by runrig (Abbot) on Apr 22, 2008 at 20:35 UTC | |
by FunkyMonk (Bishop) on Apr 22, 2008 at 22:43 UTC | |
by mikejones (Scribe) on Apr 24, 2008 at 20:49 UTC |