Am Wed, 24 Jun 2009 15:18:02 +0100
schrieb Peter Humphrey <pe...@humphrey.ukfsn.org>:
> On Wednesday 24 June 2009 12:28:05 Alex Schuster wrote:
> 
> > man sed answers your second question :)
> 
>  s/regexp/replacement/
>      Attempt to match regexp against the pattern space. If successful,
>      replace that portion matched with replacement. The replacement
> may contain the special character & to refer to that portion of the
> pattern space which matched, and the special escapes \1 through \9 to
> refer to the corresponding matching sub-expressions in the regexp.
> 
> No mention of using a different separator, and I couldn't find any
> other reference either. I did look before asking.

Man page is very short. Check the info pages for full documentation.
(Almost all tools from GNU userland have a short man page and a long
info page. At least that is what they say right at the bottom.)

Section 3.5 (The `s' Command) states in the first paragraph:

  The syntax of the `s' (as in substitute) command is
  `s/REGEXP/REPLACEMENT/FLAGS'.  The `/' characters may be uniformly
  replaced by any other single character within any given `s' command.
  The `/' character (or whatever other character is used in its stead)
  can appear in the REGEXP or REPLACEMENT only if it is preceded by a `\'
  character.


Cheers,
Renat

-- 
Probleme kann man niemals mit derselben Denkweise loesen,
durch die sie entstanden sind.
                                              (Einstein)

Attachment: signature.asc
Description: PGP signature

Reply via email to