in reply to Re^2: regex and matching
in thread regex and matching
* means= match ZERO or more of the previous character or group. In this case it is the ZERO that wins. The matched part of the string is ' or modern'.
Try print "True/ >$1<\n"; and you will see what got matched by the first \w*.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|