From a5d1526fbbec4b89c0e400c4e501668fa14cc51c Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 8 Feb 2002 12:43:59 +0000 Subject: [PATCH] Added docs for forward lookahead asserts. [SVN r12757] --- syntax.htm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/syntax.htm b/syntax.htm index 10e01b8d..f6b18f8f 100644 --- a/syntax.htm +++ b/syntax.htm @@ -157,9 +157,18 @@ but don't want the parenthesis to spit out another marked sub-expression, in this case a non-marking parenthesis (?:expression) can be used. For example the following expression creates no sub-expressions:

-

"(?:abc)*"

+

"(?:abc)*"

+ +

Forward Lookahead Asserts 

+ +

There are two forms of these; one for positive forward +lookahead asserts, and one for negative lookahead asserts:

+ +

"(?=abc)" matches zero characters only if they are +followed by the expression "abc".

+ +

"(?!abc)" matches zero characters only if they are +not followed by the expression "abc".

Alternatives