The canonical search and replace
operator, as used in sed
and any other tool that makes use of regular expression
Any valid regular expression may be sought as pattern
. If the
operator is followed by
, all occurrences of the pattern are replaced, instead of just the first found; if followed by
, the matching is case-insensitive.
A full discussion of the syntax of
s/// is beyond the scope of this writeup, and may be better served by the Perl manual, or the excellent O'Reilly book Mastering Regular Expressions.
s/// form is often seen in text-based chat environments, where it is used to correct typos in one's previous statements, or humorously in the same manner
^H often is.