mirror of
https://github.com/boostorg/regex.git
synced 2025-07-15 21:32:18 +02:00
Update docs on empty alternatives.
[SVN r27419]
This commit is contained in:
@ -132,6 +132,14 @@ aaaa</PRE>
|
||||
</P>
|
||||
<P>Parenthesis can be used to group alternations, for example: ab(d|ef) will match
|
||||
either of "abd" or "abef".</P>
|
||||
<P>Empty 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>
|
||||
<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
|
||||
|
@ -132,6 +132,14 @@ aaaa</PRE>
|
||||
</P>
|
||||
<P>Parenthesis can be used to group alternations, for example: ab(d|ef) will match
|
||||
either of "abd" or "abef".</P>
|
||||
<P>Empty 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>
|
||||
<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
|
||||
|
Reference in New Issue
Block a user