#!/usr/bin/perl -w $string = "Test: FileNames can't have / \\ and other special character +s"; %s = (":" => "COLON", "/" => "FSLASH", "\\" => "BSLASH"); $t = (join "|", map quotemeta($_), (keys %s)); $string =~ s/($t)/$s{$1}/g; print "$string\n";
In reply to Re: Is Group Substitution Possible?
by Anonymous Monk
in thread Is Group Substitution Possible?
by ketema
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |