Update docs on empty alternatives.

[SVN r27419]
This commit is contained in:
John Maddock
2005-02-18 17:15:24 +00:00
parent ecd5dd5ff3
commit f736d985fb
2 changed files with 18 additions and 2 deletions

View File

@ -132,6 +132,14 @@ aaaa</PRE>
</P> </P>
<P>Parenthesis can be used to group alternations, for example: ab(d|ef) will match <P>Parenthesis can be used to group alternations, for example: ab(d|ef) will match
either of "abd" or "abef".</P> either of "abd" or "abef".</P>
<P>Empty&nbsp;alternatives are not allowed (these are almost always a mistake),
but if you really want an empty alternative use (?:) as a placeholder, for
example:</P>
<BLOCKQUOTE dir="ltr" style="MARGIN-RIGHT: 0px">
<P>"|abc" is not a valid expression, but<BR>
"(?:)|abc" is and is equivalent, also the expression:<BR>
"(?:abc)??" has exactly the same effect.</P>
</BLOCKQUOTE>
<H4>Character sets:</H4> <H4>Character sets:</H4>
<P>A character set is a bracket-expression starting with [ and ending with ], it <P>A character set is a bracket-expression starting with [ and ending with ], it
defines a set of characters, and matches any single character that is a member defines a set of characters, and matches any single character that is a member

View File

@ -132,6 +132,14 @@ aaaa</PRE>
</P> </P>
<P>Parenthesis can be used to group alternations, for example: ab(d|ef) will match <P>Parenthesis can be used to group alternations, for example: ab(d|ef) will match
either of "abd" or "abef".</P> either of "abd" or "abef".</P>
<P>Empty&nbsp;alternatives are not allowed (these are almost always a mistake),
but if you really want an empty alternative use (?:) as a placeholder, for
example:</P>
<BLOCKQUOTE dir="ltr" style="MARGIN-RIGHT: 0px">
<P>"|abc" is not a valid expression, but<BR>
"(?:)|abc" is and is equivalent, also the expression:<BR>
"(?:abc)??" has exactly the same effect.</P>
</BLOCKQUOTE>
<H4>Character sets:</H4> <H4>Character sets:</H4>
<P>A character set is a bracket-expression starting with [ and ending with ], it <P>A character set is a bracket-expression starting with [ and ending with ], it
defines a set of characters, and matches any single character that is a member defines a set of characters, and matches any single character that is a member