in reply to Non-greedy regex behaves greedily
Because you insist on a character after 'body' that isn't there when you use '.+?'.
Change it to s/<body.*?>/<body class="theBody">/ and it will work.
In Section
Seekers of Perl Wisdom
in reply to Non-greedy regex behaves greedily
Change it to s/<body.*?>/<body class="theBody">/ and it will work.