in reply to regex greediness
I thought that using '(.*?)' would match up to 'b'
Why would it do that when it can match zero times?
EDIT: Why would it do that when it can match zero times? I guess I was thinking that since (?:b=(\w))? prefers to match once it would influence the behavior of .*? in an analogous way to how (?:b=(\w)) would, which, as you explained, isn't the case.