4 ms·
I found other patterns that I thought were unsimplified, but (spoiler alert) in the end it turned out that all of the seemingly-unnecessary details were importa
by rav 6y ago
I found other patterns that I thought were unsimplified, but (spoiler alert) in the end it turned out that all of the seemingly-unnecessary details were important for the solution! E.g.
[^C]*[^R]*
LOOKS unsimplified, but it actually means that if the string contains an R, the preceding characters CANNOT be C.
- justusthane 6y agoOr if the string contains a C, a subsequent character can't be an R? Doesn't it really just mean a string can't contain a C followed by an R?
- DavidSJ 6y agoYes, those are three ways of saying the same thing. :)
- justusthane 6y agoNot really. Maybe I'm being overly pedantic, but my point was that the first two ways of describing it are overly specific and don't include all the strings that can be matched. Only the third option really describes all the possibilities.
- DavidSJ 6y agoWhat is an example of a string that can be matched which does not meet the first or second description?
- justusthane 6y agoSorry, you're right. I'm not sure what I was thinking.