I'm trying to use sed
to replace 'version' => '1.2.3',
with 'version' => '1.2.4',
.
Here's what I've tried:
echo " 'version' => '1.2.3', " | sed -E 's/([\s]*[\"\']version[\"\'][\s]*=>[\s]*[\"\'])[-_a-zA-Z0-9\.]+([\"\'][,]?)/\11.2.4\2/'
Here's what my shell tells me:
zsh: parse error near `)'
I've tried the same regex (minus the replacement part) on some online regex testers and it seems to work there. So why doesn't it work when I use it with sed
?