| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
I am trying to understand the working of ^ and $ in the middle of a regexp with gnused 4.2.1. The help file says they are considered as normal characters (except at start and end of sub expressions).
This can be checked with (xa^by in input.txt):
sed -n -e "/a^b/p" input.txt
sed -n -e "/\(a^b\)/p" input.txt
However when using the -r switch, none of the previous commands work as expected:
sed -r -n -e "/a^b/p" input.txt
sed -r -n -e "/(a^b)/p" input.txt
This is puzzling. Am I missing something?