GutiMac GutiMac - 4 months ago 8x
Bash Question

Replace a String with a substring of the first one

I am looking for a sed command or even with node replace a way to do this:


ISODate("Something inside"),
ISODate("Other thing"),

Pass sed command or a node command to file.txt and the output would be:

"Something inside",
"Other thing",

I am trying to use regexp in replace but I can't remove the last ')'.

Any idea??

Thanks in advaned.


As for you exmaple:

sed "s/^\(.*\)ISODate(\(.*\))\(.*\)$/\1\2\3/g" file.txt