You're very welcome. It may seem a bit churlish to bring this up after your gracious thanks, but it dawned on me that the subject of the OP was familiar, and I was right: Re^3: Substitution don't work discusses a similar problem. Updates 2 & 3 there give contrasting examples of .* versus .*? (greedy versus lazy) behavior. (Also see the discussion there of the effect of the /s regex modifier on the behavior of the . (dot) metacharacter when matching against a multi-line string.)
These comments are not intended to give you a hard time, but to suggest that the advice of the humble Monks will be of more value to you the more attention you pay it.
Give a man a fish: <%-{-{-{-<
In reply to Re^3: How to modify my regex?
by AnomalousMonk
in thread How to modify my regex?
by OldChamp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |