Consider the following text:
foo:·····¶
·bar x··¶
·lorem ipsum····¶
dolorsitamet···¶
···¶
consectetur adipiscing elit:
Where midpoints indicate spaces, and ¶denotes a new line.
The regular expression (?:foo:\s*)(.+)(?:\n\s*)matches the three spaces in the white space, but the regular expression (?:foo:\s*)(.+)(?:\n\s+)matches and does not include the new line following dolorsitamet. Why is the symbol * not behaving greedily? One would expect the third group (?:\n\s*)to fit
¶
···¶`
My regex mode is multi-line, dotted.
source
share