A regex quantifier like * or + means "the preceding element can repeat any number of times," but how much it actually matches depends on whether the engine tries to match as much as possible or as little as possible. That's the greedy vs. non-greedy distinction, and adding a single ?
Source: [Dev.to](https://dev.to/susumun/greedy-vs-non-greedy-regex-why-the-same-pattern-can-match-differently-3eg3)