Guide on regexps: clarify that {m}? is the same as {m}

As noted by Jussi Salmela.
This commit is contained in:
Matthew Flatt 2018-11-08 17:51:27 -07:00
parent 1b5fc19687
commit fd8c2b2c20

View File

@ -500,10 +500,13 @@ needed to ensure an overall match.
(regexp-match #rx"<.*?>" "<tag1> <tag2> <tag3>") (regexp-match #rx"<.*?>" "<tag1> <tag2> <tag3>")
] ]
The non-greedy quantifiers are respectively: @litchar{*?}, The non-greedy quantifiers are @litchar{*?}, @litchar{+?},
@litchar{+?}, @litchar{??}, @litchar["{"]@math{m}@litchar["}?"], @litchar{??}, @litchar["{"]@math{m}@litchar["}?"], and
@litchar["{"]@math{m}@litchar{,}@math{n}@litchar["}?"]. Note the two @litchar["{"]@math{m}@litchar{,}@math{n}@litchar["}?"], although
uses of the metacharacter @litchar{?}. @litchar["{"]@math{m}@litchar["}?"] is always the same as
@litchar["{"]@math{m}@litchar["}"]. Note that the metacharacter
@litchar{?} has two different uses, and both uses are represented in
@litchar{??}.
@; ---------------------------------------- @; ----------------------------------------