Commit ba44fca9 authored by Luc Teirlinck's avatar Luc Teirlinck
Browse files

(Regexp Special): Use @samp for regular expressions that are not in

Lisp syntax.
parent 6f49b4c5
...@@ -476,7 +476,7 @@ never remove the special meaning of @samp{-} or @samp{]}. So you ...@@ -476,7 +476,7 @@ never remove the special meaning of @samp{-} or @samp{]}. So you
should not quote these characters when they have no special meaning should not quote these characters when they have no special meaning
either. This would not clarify anything, since backslashes can either. This would not clarify anything, since backslashes can
legitimately precede these characters where they @emph{have} special legitimately precede these characters where they @emph{have} special
meaning, as in @code{[^\]} (@code{"[^\\]"} for Lisp string syntax), meaning, as in @samp{[^\]} (@code{"[^\\]"} for Lisp string syntax),
which matches any single character except a backslash. which matches any single character except a backslash.
In practice, most @samp{]} that occur in regular expressions close a In practice, most @samp{]} that occur in regular expressions close a
...@@ -485,8 +485,8 @@ regular expression may try to match a complex pattern of literal ...@@ -485,8 +485,8 @@ regular expression may try to match a complex pattern of literal
@samp{[} and @samp{]}. In such situations, it sometimes may be @samp{[} and @samp{]}. In such situations, it sometimes may be
necessary to carefully parse the regexp from the start to determine necessary to carefully parse the regexp from the start to determine
which square brackets enclose a character alternative. For example, which square brackets enclose a character alternative. For example,
@code{[^][]]} consists of the complemented character alternative @samp{[^][]]} consists of the complemented character alternative
@code{[^][]} (which matches any single character that is not a square @samp{[^][]} (which matches any single character that is not a square
bracket), followed by a literal @samp{]}. bracket), followed by a literal @samp{]}.
The exact rules are that at the beginning of a regexp, @samp{[} is The exact rules are that at the beginning of a regexp, @samp{[} is
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment