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

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
jhh3000
Posts: 1
Joined: Tue Feb 15, 2005 5:55 pm

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

Post 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.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post by DataMystic Support »

Can you please address your questions to email OR the forums, not
BOTH?

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.
Post Reply