A question mark after `*` or `+` makes the quantifier non-greedy: it matches the fewest repetitions that still let the rest of the pattern succeed. Unlike a greedy quantifier, it can stop at the first `!` rather than the last. section 11.5.2
Greedy matching is not absolute: the regexp engine can backtrack when needed to make the whole pattern match. For example, `\d+` in `/\d+5/` matches `234`, leaving `5` for the rest of the pattern. section 11.5.2
>> /.+?!/.match(string)[0]
=> "abc!"
Compare this with the greedy `/ .+! /` example: adding `?` makes the match stop at the first exclamation point. section 11.5.2
Matching across lines
In `/\(.*?\)/m`, `.*?` matches the fewest characters through a closing parenthesis; the `m` modifier lets the wildcard match newline characters. section 11.5.4
