RE: forward look ahead assertion

"Lilantha Darshana" <[email protected]> Thu, 6 Nov 2003 14:32:51 +0600
Newsgroups gmane.comp.jakarta.regexp.user
Message-ID <28B8E04BCFBEB74B9B19F765DE6598E941EDAA@ENETSLMAILI.enetsl.Virtusa.com>
ORO will do what I need 
Thanks
-Lilantha

-----Original Message-----
From: Daniel F. Savarese [mailto:[email protected]]
Sent: Thursday, November 06, 2003 1:43 PM
To: Regexp Users List
Subject: Re: forward look ahead assertion 



In message <28B8E04BCFBEB74B9B19F765DE6598E94C867A@ENETSLMAILI.enetsl.Virtusa.c
om>, "Lilantha Darshana" writes:
>Could you tell me whether the regexp supports forward look ahead =
>assertion or not? If not how could we
...
>I.e. xyz should not follow any other characters.

I assume you mean that "xyz should not be followed by any other
characters"

>In Perl we could achieve this kind of matching using pattern like: =
>(?:abc.xyz)(?!\w)

That's actually a zero-width negative lookahead assertion.  I don't
believe regexp supports lookahead or lookbehind assertions.  You'd
need to use jakarta-oro for that.  However, I don't understand why
^abc.xyz$ doesn't do the job for you in this case since you're asking
for an exact match.  Unless you really mean for it to be okay for
non-word characters to follow the string.

daniel



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]