Could somebody explain to me, why this is not working:
# echo '"Hello,1" "Hello,2" "Hello,3"' | perl -pe 's/".+?,3"/1/'
1
or
# echo '"Hello,1" "Hello,2" "Hello,3"' | perl -pe 's/".+?,2"/1/'
1 "Hello,3"
My intention was to replace/find only "Hello,3"/"Hello,2", but It seems that the non-greedy modifier (or my brain) is not working as expected.