In TC's help about regular expressions, quantifiers such as * , + , {n} , {n,m} , etc. are explained in the section "Iterators".
However, an entry for the ? quantifier (the short form of {0,1}) is missing.
(Well, there is an explanation for the greediness modifier - which also uses the same symbol ?, but no explanation about the quantifier ?.)
[SOLVED] TC Help: Documentation for regular expressions does not explain ? quantifier
Moderators: Hacker, petermad, Stefan2, white
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
[SOLVED] TC Help: Documentation for regular expressions does not explain ? quantifier
Last edited by gdpr deleted 6 on 2021-03-12, 13:24 UTC, edited 1 time in total.
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: TC Help: Documentation for regular expressions does not explain ? quantifier
I'm not aware of such an operator ? - are you sure it means the same as {0,1} ?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
Re: TC Help: Documentation for regular expressions does not explain ? quantifier
Yes. Try it yourself...ghisler(Author) wrote: 2021-02-03, 14:49 UTC I'm not aware of such an operator ? - are you sure it means the same as {0,1} ?
For instance, given a text file with
Code: Select all
Hello
Hullo
Heello
Or, if you prefer file name search, given four files:
Code: Select all
abc.txt
ac.txt
abbc.txt
adc.txt
The ? quantifier with the meaning of {0,1} is a common basic quantifier in most regex flavours. It is also documented on the TRegExpr website: https://regex.sorokin.engineer/en/latest/regular_expressions.html#quantification (although the wording "similar" for the *,+,? explanations chosen there is also a bit unfortunate, because these quantifiers are not just similar but equivalent to the mentioned {0,} , {1,} and {0,1} notations)
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
Re: TC Help: Documentation for regular expressions does not explain ? quantifier
? quantifier now explained in help files for TC 10.00b1a (both english and german).
Thanks!
Thanks!