Replacing using regexes
- Instead of m// , use
s///
- s/FSC/Follett Software Company/;
would spell out FSC.
- s/(Chuck|Charles) (E\.
)?Follett/Tom Schenck/i; changes a number of variations on
Chuck's name to Tom's. The /i
makes it case-insensitive in the match.
Replacing with backreferences
- The replacement part of a regex can contain references to the search
part.
- s/(\d\d)-(\d\d)-(\d\d\d\d)/$3$1$2/;
changes
dates in the form "mm-dd-yyyy" to "yyyymmdd" for sorting. |
|
|