I created a test using grep
but it does not work in sed
.
grep -P '(?<=foo)bar' file.txt
This works correctly by returning bar
.
sed 's/(?<=foo)bar/test/g' file.txt
I was expecting footest
as output, but it did not work.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…