in reply to extracting number from string
Alternatively, use a regular expression capture.
$ perl -le ' $str = q{Price 15.40}; ( $str ) = $str =~ m{(\d+\.\d+)}; print $str;' 15.40 $
I hope this is useful.
Cheers,
JohnGG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: extracting number from string
by apl (Monsignor) on Mar 05, 2009 at 12:40 UTC |