1

Say you have the following string:

var string = "This shirt, is very nice. It costs DKK 1.500,00";

I want a function that will return 1.500,00.

The point is, that I only want to allow commas and dots that occur between numbers so I don't end up with: ,.1.500,00

How would you do this using regexp in javascript?

4

3 に答える 3

3

これはどうですか~\b\d[.,\d]*\b

于 2013-04-12T11:05:34.657 に答える