Possible Duplicate:
Difference between .? and . for regex
I was reading this question, and noticed that many of the regular expressions in the answers used .*?
to match intermediate text, rather than just .*
.
To my mind, using .*
will match any character zero or more times. Adding ?
would be superfluous, as it would just modify "zero or more" to "zero or more once, or nothing" (in other words, "zero or more, or zero").
Does .*?
represent a special regex sequence, or is it just an odd way to write .*
with more characters?