Quote:
Originally Posted by Manichean
Without intending any offense, at least in one point, it's the latter: You should have a look at where you put your quantifiers (they repeat the preceding characters).
|
This is actually a very common mistake. It's based on familiarity with wildcards, where the "*"
is a character, whereas in regex it's a quantifier for something else. An ab initio reading of the explanation of regex "*" and "+" sometimes causes the user to think they are wildcards for "zero or more characters" and "one or more characters" instead of quantifiers meaning "zero or more of the preceding character(s)" and "one or more of the preceding character(s)."
It's a very understandable error for anyone familiar with wildcards, but not quantifiers. (Perhaps it's worth a brief comment in your excellent beginner's tutorial about the difference between wildcards and quantifiers.)