Thursday, 28 July 2016

bash - Sed regex ".*?=" string doesn't replace correct string

I have the following line:
echo 'var="string"' | sed "s/.*?=/replace=/g"



Output:
var="string"



Expected output:
replace="string"



When tested on regex.101, the regex .*?= successfully gets the correct part of the string. Why doesn't sed work with this?

No comments:

Post a Comment