Regular expression syntax
Lazy quantifier
Tries fewer repetitions first, while allowing more if needed for the remainder.
Formal Syntax & Structure
javascript syntaxjavascript
a+?Working Example
Example Snippetjavascript
console.log(/a+?/.exec("aaa")[0]);