Page 1 of 1

problems with numbers and digit grouping! big problem...

Posted: Tue Feb 15, 2005 6:13 pm
by jhh3000
I am trying to parse some information, but noticed a roadblock that I have spent three hours on and have not yet solved: how is it possible to find, in a pattern, a variable-digit number that has digit grouping?

For example (taking a simple find and replace utilizing the EasyPattern language),

A few of the values that appear in the text document I'm parsing show up (exactly) as:

2112493 2112493 4823 4823 29 29

And if I were to do a simple easypattern find [oneOrMore digits] replace $0, I would end up with:

2112493, 2112493, 4823, 4823, 29, 29,

Which is great and all, but in reality, most of the values that appear in the document show up as:

2,112,493 2,112,493 4,823 4,823 29 29

And I am stumpted as to how to write a find algorithm that would treat each number as one entity, and letting me put a comma or whatever I wanted after each number.

Posted: Wed Feb 16, 2005 11:40 am
by DataMystic Support
Can you please address your questions to email OR the forums, not

EasyPatterns default to the shortest match, so you need to use

[ longest 1+ digits ]

Unless the rest of the pattern forces it to make a longer match e.g.

[ 1+ digits, whitespace ]

Would force a longer match.