is finding out to<body.+?
and then continuing out till it hits the next closing bracket. Problem is + finds AT LEAST one character. You want the star * here:<body>
* finds 0 or more characters. That should solve it! :)s/<body.*?>/<body class="theBody">/is
In reply to Re: Non-greedy regex behaves greedily
by tphyahoo
in thread Non-greedy regex behaves greedily
by fourmi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |