Hi,
I need to do a simple command line substitution of a string, but I'm obviously making some mistake, as it doesn't work:
> echo "Hello Dolly" | perl -lpe "s/l(lo)/$1/" He Dolly
I'm probably missing something completely silly, but I can't understand why the $1 doesn't capture the lo in the parentheses... (I want the output to be Helo Dolly)
Thanks a lot!
In reply to Regex capturing by anna_black
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |