|
Posted by Glenn Jackman on April 16, 2008, 3:42 pm
Please log in for more thread options
At 2008-04-16 03:08PM, "PugetSoundSylvia@gmail.com" wrote:
> In a string, I need to replace all instances of 15 or 16 number
> characters with the 11 or 12 "x" characters, then the last 4 digits of
> the 15 or 16 number characters. The chunk of number characters may
> appear numerous times in the string.
You want s/(\d)(\d)/"x" x length($1) . $2/eg
Note the 'e' modifier
--
Glenn Jackman
"If there is anything the nonconformist hates worse than a conformist,
it's another nonconformist who doesn't conform to the prevailing
standard of nonconformity." -- Bill Vaughan
|