in reply to Re^2: Match Optional Groups with 1 Required Group
in thread Match Optional Groups with 1 Required Group
? is zero or one. You need *, which is 0 or more.:
print "$_: ", m[^\w+(?:\.\w+)*$] ? "matched\n" : "failed\n" for qw[ one one.two one.two.three four.five.six.seven one. one-tw +o ];; one: matched one.two: matched one.two.three: matched four.five.six.seven: matched one.: failed one-two: failed
Each title needs at least one character as well.
+ means 1 or more, so that's covered by \w+
|
|---|