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

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...