You are viewing limited content. For full access, please sign in.

Question

Question

How do I Pattern Match a sentence literally for Workflow?

asked on June 4, 2015

I am working on a workflow that will lift values from a Tax Return using Pattern matching. I can't figure out how to find sentences literally instead of building a character based pattern match for the sentence. I have pasted an example of the sentence I am trying to find, the bolded text is what I need for the workflow.

   Income   7   Wages,salaries,tips,etc.Attach Form(s)W-2           7      1 , 502 , 397 .

 

What is the correct Pattern, either to match the whole sentence or just the bolded text?

Thank you in advance laugh

0 0

Replies

replied on June 5, 2015

Something like this should work:

\s+Income\s+\d\s+Wages,salaries,tips,etc.Attach\s+Form\(s\)W-2\s+7\s+([\d\.,\s]+)

Basically, you take the sentence and replace the spaces with \s (\s+ means one or more consecutive spaces). Then you add a \ in front of regular expression reserved characters like periods, parentheses and such. Then you surround the part you want extracted by parenthesis. Then you look at the data to guess the pattern. In this case, we have numbers (\d), commas, periods (\.) and spaces (\s). So we want anything in that range of characters.

0 0
replied on June 9, 2015

Thank you Miruna! It worked perfectly. Thank you for your help!smiley

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.