Perl

My *very* small collection of all things perl …

Perl string manipulation
There are two main forms for regex, and they are “match” and “substitute” and they look like this:

# Just match on a pattern.
m/pattern/;

and

# Match on pattern, and replace any matches found with ‘replacement’
s/pattern/replacement/;

(Strangely enough, the “m” stands for “match” and the “s” for “substitute”. :-)

Leave a Reply

You must be logged in to post a comment.