RE: Regex matching of patterns in variables

2004-03-03 Thread Ted S.
Steven Manross graced perl with these words of wisdom: > R U sure it's not the while loop.. I've never seen that incantation > b4.. But that's not surprising.. I'm not the most traveled perler.. That while loop is how you process a file line by line. -- Ted Schuerzinger The way I see it, y

RE: Regex matching of patterns in variables

2004-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
hey all, Scratchin' my head on this one for a couple of hours now, looking at camels. sheep and other documentation creatures to no avail. I'm trying to match a pattern that's already (must be) in a variable like so: $var = "coyote"; while () { if ($_ =~ /$var/i) { print $_ . " matches\

Re: Regex matching of patterns in variables

2004-03-03 Thread John Deighan
At 04:58 PM 3/3/2004, Moulder, Glen wrote: hey all, Scratchin' my head on this one for a couple of hours now, looking at camels. sheep and other documentation creatures to no avail. I'm trying to match a pattern that's already (must be) in a variable like so: $var = "coyote"; while () { if (

RE: Regex matching of patterns in variables

2004-03-03 Thread Steven Manross
y, March 03, 2004 2:58 PM To: perl-win32-users Subject: Regex matching of patterns in variables hey all, Scratchin' my head on this one for a couple of hours now, looking at camels. sheep and other documentation creatures to no avail. I'm trying to match a pattern that's alre

Re: Regex matching of patterns in variables

2004-03-03 Thread Andy_Bach
Works fine here - 'course the '.' in Wile E. is going to match any char so: Wile E. Coyote matches Wile Ej Coyote matches Wile E. Coyotexxx matches using quotemeta or \Q: #my $var = "coyote"; my $var = quotemeta "Wile E. Coyote"; while () { if ( /$var/oi) { print $_ . " matches\n"; }

Regex matching of patterns in variables

2004-03-03 Thread Moulder, Glen
hey all, Scratchin' my head on this one for a couple of hours now, looking at camels. sheep and other documentation creatures to no avail. I'm trying to match a pattern that's already (must be) in a variable like so: $var = "coyote"; while () { if ($_ =~ /$var/i) { print $_ . " matches\n