S
Steventangle
ITEM 0
How does one go about changing a longer pattern to a shorter one? For
instance, I try
$string =~ tr/longer/short/;
but it doesn't change "This is a longer pattern." to "This is a short
pattern." Rather, it does a one-for-one replacement yielding "This is a
shortr pattrro."
ITEM 1
How do you use variables in regexes? For instance, if I wanted to replace
the variable $var with $string, what's the tr or s syntax for it?
Thanks for the help,
Steve
How does one go about changing a longer pattern to a shorter one? For
instance, I try
$string =~ tr/longer/short/;
but it doesn't change "This is a longer pattern." to "This is a short
pattern." Rather, it does a one-for-one replacement yielding "This is a
shortr pattrro."
ITEM 1
How do you use variables in regexes? For instance, if I wanted to replace
the variable $var with $string, what's the tr or s syntax for it?
Thanks for the help,
Steve