in reply to Re: Perl One Liner Regular Expressions
in thread Perl One Liner Regular Expressions

No need for parentheses; nor to escape the space; nor for the 'g' modifier - '.*' will gobble everything up, thus there can be only one match. So:

perl -p -i -e "s/^macros.*/macros regex/" monks.txt # or perl -p -i -e "s/^macros\K.*/ regex/" monks.txt