Reputation: 135
I'm attempting to parse thousand/million/hundred million values out of plaintext. I need to exclude commas and decimals from the typical word boundaries so 1,000,000 doesn't return multiple hits. I need my values to be exclusive and only match at the highest number. How do I recreate word boundary functionality that ignores commas and decimals?
Upvotes: 0
Views: 255
Reputation: 551
Word boudary \b does not include commas, it includes: (^\w|\w$|\W\w|\w\W) , \w represents: [a-zA-Z0-9_] and \W is like NOT \w in this way: [^a-zA-Z0-9_]
Maybe you need this : [\d,.]+
It will match 1,000,000 or 1,000.000 ...
Upvotes: 3