On 9 May, Sean Walberg wrote:
The * operator is greedy, in perl .*? probably would have worked, I'm not sure if that feature exists in sed. Google around for "backtracking",
Sean beat me to it. Perl's non-greedy *? is what you want. Without it you're taking the most left-most first. I use perl's non-greedy modifiers *all* the time. Plus, perl let's you use \d instead of the horrific posix [[:digit:]] syntax.