Mail Archives: djgpp/1997/10/01/05:21:58
On Tue, 30 Sep 1997, Douglas G. Fowley wrote:
> To answer my own question, I hacked into the source. In sed.c,
> function compile_regex(), on line 1045, the code to recognize
> '\b', '\f', '\t', and '\r' has been turned off. When I turn
> the code back on, re-make, and run the test again, I get:
>
> C:\temp>sed -e "s/\t/<TAB>/" test
> this is a TAB \<TAB>\
>
> which is what I expect. Anyone know why the SED code fragment
> is turned off?
GNU Sed is written to certain specifications, because Sed scripts must
be portable across various implementations of Sed. The Sed
specifications do NOT include support for \t and the rest of such
characters in regular expressions, because the original Unix Sed
didn't support them. That is why the code that supports them in GNU
Regex package is turned off.
To find lines with a TAB, type the TAB character on the Sed command
line verbatim.
- Raw text -