Well, first I think that you need a positive look ahead.  I believe a
negative look ahead checks to make sure something is *not* there.  The .*
just before your negative look ahead will match everything to the end of the
string.  Then since you are at the end, the negative look ahead does not
find a match which is considered 'good'.
 
Also, you should consider using a non-greedy match on the .* before the look
ahead so that the .* doesn't miss the first occurrence of what it is looking
for.  
 
Based on your English translation, the character set '[.\s]' would be a
better choice than '\.*\s' and '-*' would be better written as '-?' 
 
Try this
 
    if (m/Blk[.\s]\d{3}.*?(?=E\d{3}-?\d{4})/i)
 
wantor

-----Original Message-----
From: Jimmy S. Lim [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 28, 2000 7:34 AM
To: Perl-Win32-Users Mailing List
Cc: Peter Van Hoecke
Subject: How to say: match this..."UNTIL..." in RegExp


hi all!
thanks in advance, can anybody help me translate english to perl? :o)
 
i would like to write in perl language:
 
if (m/Blk\.*\s*\d{3}.*(?!E\d{3}-*\d{4})/i)
 
i want to tell Perl this in english: 
" find Blk followed by a period or a space, followed by 3 digits, and
followed by any character or characters along the way UNTIL (then stop) you
find an E with 3 digits plus a - or w/o a - followed by 4 digits, then
return the match.
 
but i still get return of everything. Perl seems to ignore my ?! negative
look ahead. is this because of the * i have? how do i solve this?
 
jimmy


---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to