Regular expressions to check numbers with currency

Hi All

I am struggling for the last one week on how to write a regular expression to search a number with currency (such as $ 1, 245, 000.00, Rs. 1, 00, 000.00 etc) but in vain . Please help me. Thanks in advance.

-----Post Update-----

Hi All

I am struggling for the last one week on how to write a regular expression to search a number with currency in PERL (such as $ 1, 245, 000.00, Rs. 1, 00, 000.00 etc) but in vain . Please help me. Thanks in advance

-----Post Update-----

Hi All

I am struggling for the last one week on how to write a regular expression to search a number with currency in PERL (such as $ 1, 245, 000.00, Rs. 1, 00, 000.00 etc) but in vain . Please help me. Thanks in advance

below perl should be ok

while(<DATA>){
	print $1,"\n" if /(\$(?:\s*[0-9]+\s*,)*\s*[0-9]+\s*\.[0-9]+)/;
}
__DATA__
line with currency $ 1, 234, 000.00
line with currency $ 1, 255.00
line with currency $ 1, 000.00
line with currency $ 1.00

can you post some sample input data and sample output pattern

INPUT

Currency $2,333,230.00 .
Currency $2,333.00 .
Currency $2.50 .

STATEMENT

$_ =~ s/(\$(?:\s*[0-9]+\s*,)*\s*[0-9]+\s*\.[0-9]+)/DOLLARS/g;

OUTPUT

Currency DOLLARS .
Currency DOLLARS .
Currency DOLLARS .

Your goal is to determine the type of currency? Like dollars or pounds or yen? If not, what is the goal?

Exactly, you are right. The regular expression should determining the type of currency, but also understand the format of the figure (such as, one million dollar ($1,000,000.00) and one lakh rupees (Rs.1,00,000.00 etc.). (Ten lakh rupees Rs.10,00,000.00 = One million Rupees Rs. 1,000,000.00)

If you need to determine just a few different currencies then use a hash table to store the symbol and its currency name:

%symbols = (
  '$' => 'US Dollars',
  'Rs' => 'Lakh Rupees',
);  

If your code need to ID many currencies you might want to find a better way, maybe an existing CPAN module or a webservice.

Thanks a lot