Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Extract Text - Extracting delimited data

avatar
New Member

Hello All,

I am trying to extract data using ExtractText such that

Original Text = T03%%350%%11502998%%2151%%3312,56%%3

String.1 = T03

String.2 = 11502998

How can I do that using ExtractText?

Also, can someone please guide me to good resources ( website, blog etc.) so that I can parse such trivial strings by myself in future? 🙂

1 ACCEPTED SOLUTION

avatar
Master Mentor
@M R

I find the following very useful when trying to build Java regular expressions:

http://myregexp.com

The Java regular expression:

^(.*?)%%(.*?)%%(.*?)%%(.*?)%%(.*?),(.*?)%%(.*?)$

It has 7 capture groups that will result in:

19414-screen-shot-2017-07-12-at-31348-pm.png

When you add a ew property to the extractText processor with a property name of "string" and use the above java regex.

Of course if you are only looking for two capture groups, you could use the following regex instead:

^(.*?)%%.*?%%(.*?)%%.*?%%.*?,.*?%%.*?$

Thanks,

Matt

View solution in original post

2 REPLIES 2

avatar
Master Mentor
@M R

I find the following very useful when trying to build Java regular expressions:

http://myregexp.com

The Java regular expression:

^(.*?)%%(.*?)%%(.*?)%%(.*?)%%(.*?),(.*?)%%(.*?)$

It has 7 capture groups that will result in:

19414-screen-shot-2017-07-12-at-31348-pm.png

When you add a ew property to the extractText processor with a property name of "string" and use the above java regex.

Of course if you are only looking for two capture groups, you could use the following regex instead:

^(.*?)%%.*?%%(.*?)%%.*?%%.*?,.*?%%.*?$

Thanks,

Matt

avatar
New Member

Thanks Matt. 🙂