in reply to Combining two actions in RegExp
By using tr/// instead of a regular expression:
$ perl -le' my $phone = "(xxx)1234-0000"; $phone =~ tr/)(/-/d; print $phone; ' xxx-1234-0000
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Combining two actions in RegExp
by Anonymous Monk on Jan 23, 2018 at 20:01 UTC | |
by Cristoforo (Curate) on Jan 23, 2018 at 20:31 UTC | |
by Anonymous Monk on Jan 23, 2018 at 21:00 UTC | |
by AnomalousMonk (Archbishop) on Jan 23, 2018 at 21:18 UTC | |
by Anonymous Monk on Jan 23, 2018 at 21:50 UTC |