Reputation: 41
I am trying regex to match decimals and commas. Code will take Bitcoin wallet account balance from API, what example would be 0.003827385,
How could regex match number like that?
Upvotes: 1
Views: 6542
Reputation: 34160
this should do it:
Regex.Match(SearchString,"[0-9]+\.?[0-9,]*");
https://regex101.com/r/fP5jI7/2
Upvotes: 5
Reputation: 3752
Why don't you just try a regex to match decimals?
([\d+[,\d]*]*\.\d+)|[\d+[,\d]*]*
Your question is not clear about usage of commas. Note the above regex will not match commas after decimal point.
Upvotes: 0