Re: trying to understand how regex works

2002-08-13 Thread Thomas R Wyant_III
Ron Grabowski <[EMAIL PROTECTED]> wrote: > my $regex = join '|', 'value_garbage1', > 'value_garbage2', > 'value_garbage3'; > next if /$regex/; You might want to say "next if /$regex/o" to prevent Perl from compiling every time. If you're Perl 5.6, yo

RE: trying to understand how regex works

2002-08-13 Thread Joseph Youngquist
ED]]On Behalf Of $Bill Luebkert Sent: Tuesday, August 13, 2002 12:39 AM To: Dan Jablonsky Cc: [EMAIL PROTECTED] Subject: Re: trying to understand how regex works Dan Jablonsky wrote: > Hi all, > I guess it must be a simple problem, but it's a > mystery to me. > I got 30 "fields&qu

Re: trying to understand how regex works

2002-08-13 Thread csaba . raduly
On 13/08/2002 06:26:59 perl-win32-users-admin wrote: >Hi all, >I guess it must be a simple problem, but it's a >mystery to me. [snip question involving regex] > >Anybody cares to explain this to me? Try running your script with perl -re=debug scriptname.pl 2>re_debug Make sure you redirect st

Re: trying to understand how regex works

2002-08-12 Thread Ron Grabowski
> open FOUT, ">>/some/path/outputfile.txt"; > open FILE ">/some/path/outputfile.txt") or die("Error: $!"); open(FILE " while{ > p="N"; > next if (/.*?\|value_garbage1\|.*?/ || > /.*?\|value_garbage2\|.*?/ || > /.*?\|value_garbage3\|.*?/); my $regex = join '|', 'value_garbage1',

Re: trying to understand how regex works

2002-08-12 Thread $Bill Luebkert
Dan Jablonsky wrote: > Hi all, > I guess it must be a simple problem, but it's a > mystery to me. > I got 30 "fields" all separated by pipes in some files > with many many lines. Some of the fields need to be > changed, but mostly I have to drop any line that has > certain values in certain fields

trying to understand how regex works

2002-08-12 Thread Dan Jablonsky
Hi all, I guess it must be a simple problem, but it's a mystery to me. I got 30 "fields" all separated by pipes in some files with many many lines. Some of the fields need to be changed, but mostly I have to drop any line that has certain values in certain fields. So I start by skipping any field