I’ve been doing regex for a while but I’m not an expert on the subtleties of what particular rules do, I’ve always done (.*?) for matching, but with restriction, as in I understood it would stop the first chance it got, whereas (.*)? would continue and be more greedy.
but I have no real reason why I think that, I just think it because I read it once upon a time.
now I’d like to know, is there a difference? and if so, what is it…
(.*?)is a group containing a non-greedy match.(.*)?is an optional group containing a greedy match.