e.g. “colou*r” matches “color” or “colour” but not “pink”.
Is this correct? I’d have thought “colo*r” matches to both “color” and “colour”, but “colou*r” only to “colour”.
Next-most complicated
Least complicated?
I’m very likely to read every post you write on this topic – I’ve gotten this book a while ago, and while it’s not a priority right now, I do intend to read it, and having two different sources explaining the material from two explicitly different angles is quite nice. (I’m mentioning this to give you a an idea of what kind of audience gets value out of your post; I can’t judge whether it’s an answer to your category resource question, although it seems very good to me.)
I initially thought that the clouds were meant to depict matches and was wondering why it wasn’t what I thought it should be, before realizing that they always depict the same stuff and were meant to depict “all stuff” before we figure out what the matches are.
Is this correct? I’d have thought “colo*r” matches to both “color” and “colour”, but “colou*r” only to “colour”.
It’s correct. Some pattern matchers work the way you describe, but in a regular expression “u*” matches “zero or more u characters”. So “colou*r” matches “color”, “colour”, “colouuuuuuuuur”, etc.
(In this case one would typically use “colou?r”; “u?” matches “exactly zero or one u characters”, that is, “color”, “colour”, and nothing else.)
Is this correct? I’d have thought “colo*r” matches to both “color” and “colour”, but “colou*r” only to “colour”.
Least complicated?
I’m very likely to read every post you write on this topic – I’ve gotten this book a while ago, and while it’s not a priority right now, I do intend to read it, and having two different sources explaining the material from two explicitly different angles is quite nice. (I’m mentioning this to give you a an idea of what kind of audience gets value out of your post; I can’t judge whether it’s an answer to your category resource question, although it seems very good to me.)
I initially thought that the clouds were meant to depict matches and was wondering why it wasn’t what I thought it should be, before realizing that they always depict the same stuff and were meant to depict “all stuff” before we figure out what the matches are.
It’s correct. Some pattern matchers work the way you describe, but in a regular expression “u*” matches “zero or more u characters”. So “colou*r” matches “color”, “colour”, “colouuuuuuuuur”, etc.
(In this case one would typically use “colou?r”; “u?” matches “exactly zero or one u characters”, that is, “color”, “colour”, and nothing else.)