I know. But you said you thought «,.+?$» searches for "the shortest possible match within the string that starts with a comma". Since neither «,» nor «$» searches for the shortest possible anything (starting with a comma or otherwise), that means you though «.+?» did that. «.+?» doesn't search for commas, which it would need to do to find "the shortest possible match within the string that starts with a comma".
In reply to Re^5: Non-greedy substitution
by ikegami
in thread Non-greedy substitution
by Bod
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |