Using REs
match (m//) or substitutions (s///)
operation/findPattern/replacePattern/options
Popular options:
- g Replace globally (s/// only).
- i Ignore case
- o Compile pattern only once.
http://www.cascss.unt.edu/~tim/perl/retestfile.txt
Notes:
By default, // assumes "m".
Can use anything !! '' --symbolk of your choice.
Dissect: operation/find/replace/options
g Replace globally, i.e., all occurrences (substitute only).
i Do case-insensitive pattern matching.
o Compile pattern only once.
The simplest regular expression: any string
perl -ne "print if m/start/;" testfile.txt