A `?` immediately after `+` or `*` makes the match *stingy* instead of *greedy* ;) Greedy matches will match as much as possible without invalidating the whole regex; in this case, what follows is optional, so the regex parser would just match everything into the first `(.+)` by default.