Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Or 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?


Yes, those are three ways of saying the same thing. :)


Not 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.


What is an example of a string that can be matched which does not meet the first or second description?


Sorry, you're right. I'm not sure what I was thinking.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: