Home > Uncategorized > Perl: Regexp to filter out/match just the price/floating point number ie digits and dots

Perl: Regexp to filter out/match just the price/floating point number ie digits and dots

April 15th, 2010 Leave a comment Go to comments

There are two ways:-

$price=~tr/0-9.//cd; # delete anything but 0-9 and a real dot

$row_array[6]=~s/[^0-9.]//g; # clean up price, remove pound/dollar sign etc

Categories: Uncategorized Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.