You only asked it to replace "sbo", not the whole line. I think you want
or the clearers/^$group:.*/$newstring/;
$_ = "$newstring\n" if /^$group:/;
I added ":" to the regex pattern so that you don't accidentally replace the group "sboadmin" (for example).
In reply to Re: How do I escape a :: in s///?
by ikegami
in thread How do I escape a :: in s///?
by xjlittle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |