gisrob has asked for the wisdom of the Perl Monks concerning the following question:
I want to write a regex that takes one of these dates, removes the decimal, and removes the first two #'s, i.e. from 1996.41064 to 9641064 I can get the pattern right, but not the replacement. Can you help fix the statement to1996.40637 1996.41064 1996.41199 1996.41467 1996.41882
get the replacement string to work? I tried using substr on the value, but this didn't work, i.e.$new = s/\d+.\d/replacement/g;
Thanks$new = s/\.//g; $new = substr($new, 2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: substr on $_
by japhy (Canon) on Sep 28, 2001 at 00:31 UTC | |
by Anonymous Monk on Sep 28, 2001 at 02:20 UTC | |
|
Re: substr on $_
by Ovid (Cardinal) on Sep 28, 2001 at 00:15 UTC | |
|
(crazyinsomniac: shock) Re: substr on $_
by crazyinsomniac (Prior) on Sep 28, 2001 at 12:02 UTC | |
by danger (Priest) on Sep 28, 2001 at 14:08 UTC | |
|
(jeffa) Re: substr on $_
by jeffa (Bishop) on Sep 28, 2001 at 00:16 UTC | |
by gisrob (Novice) on Sep 28, 2001 at 00:47 UTC | |
|
Re: substr on $_
by virtualsue (Vicar) on Sep 28, 2001 at 17:39 UTC | |
|
Re: substr on $_
by dragonchild (Archbishop) on Sep 28, 2001 at 00:14 UTC |