Can these two regular expression expressions give a different result?
perl -pe 's/.*c//s'
perl -0777 -pe 's/.*c//s'
Where .*ccan I replace anything ..
In case the .*cresult will be the same
$ echo -e 'a\nb\nc\nd' | perl -pe 's/.*c//s'
a
b
d
$ echo -e 'a\nb\nc\nd' | perl -0777 -pe 's/.*c//'
a
b
d
And the question is re the difference between regular expressions, where that echo can be replaced with something too.
Are -0777and /sinterchangeable?
And it makes no sense to do as -0777with /s?
source
share