See the perlretut tutorial on regular expressions and search for this (which specifically deals with s///)
This example counts character frequencies in a line:In reply to Re: Replacement regular expression which return the number of replacement it does
by Pancho
in thread Replacement regular expression which return the number of replacement it does
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |