[prev] [index] [next]

Repetition (cont)

If a pattern can match several parts of the input, the first and longest match is chosen.

Examples:

Pattern Text (with match underlined)
[0-9]+ i=1234   j=56789
[ab]+ aabbabababaaacabba
[+]+ C++ is a hack