Greedy versus lazy
Pattern | Meaning |
---|---|
* + {n,} greedy |
Match as much as possible |
<.+> |
Finds 1 big match in bold |
*? +? {n,}? lazy |
Match as little as possible |
<.+?> |
Finds 2 matches in bold |
Comments
Pattern | Meaning |
---|---|
* + {n,} greedy |
Match as much as possible |
<.+> |
Finds 1 big match in bold |
*? +? {n,}? lazy |
Match as little as possible |
<.+?> |
Finds 2 matches in bold |