Re: sed: backreference in substitution does not work as expected
From: Chris Mattern (syscjm_at_gwu.edu)
Date: 12/29/03
- Next message: Mikey: "Re: sed: backreference in substitution does not work as expected"
- Previous message: Icarus Sparry: "Re: (HOWTO) Deleting Microsoft spams on POP3 server"
- In reply to: Ronald Fischer: "sed: backreference in substitution does not work as expected"
- Next in thread: Ronald Fischer: "Re: sed: backreference in substitution does not work as expected"
- Reply: Ronald Fischer: "Re: sed: backreference in substitution does not work as expected"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Dec 2003 13:44:59 -0500
Ronald Fischer wrote:
> Could some friendly soul tell me why
>
> ... | sed -e 's/a(.)b/\1/'
>
> causes the error message
>
> sed: Function s/a(.)b/\1/ cannot be parsed
>
Because you have no referent for "\1". In sed
REs, if you wish parentheses to be metacharacters,
you must escape them with backslashes. This will
work:
sed -e 's/a\(.\)b/\1/'
Chris Mattern
- Next message: Mikey: "Re: sed: backreference in substitution does not work as expected"
- Previous message: Icarus Sparry: "Re: (HOWTO) Deleting Microsoft spams on POP3 server"
- In reply to: Ronald Fischer: "sed: backreference in substitution does not work as expected"
- Next in thread: Ronald Fischer: "Re: sed: backreference in substitution does not work as expected"
- Reply: Ronald Fischer: "Re: sed: backreference in substitution does not work as expected"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|