Using "Contains Match" with several words?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Using "Contains Match" with several words? Thu Nov 07, 2019 9:46 am • by The_Phi
Hi!

I'm trying to use "contains match" to fill up a custom pattern.
This works well, as long as I'm looking for a single word as "match".

I have he following text within my PDF files:
1) "Yearly Invoice" {...some more text...} "Gas"
2) "Yearly Invoice" {...some more text...} "Electricity"

As long as I'm just looking for "Yearly Invoice" everything is fine, my custom pattern is filled with "Yearly Invoice" correctly.
But I'm trying to differ between Gas and Electricity, so I want to match TWO words within a "contain match".
Goal is to have "Yearly Invoice Gas" or "Yearly Invoice Electricity" within my custom pattern.
I tried several combinations like "Yearly Invoice (ab12%?) Gas" or "Yearly Invoice (...) Gas (...)" but had no success.

Is there any possibility to look for several words at different positions within a document in ONE "content match" condition / custom pattern?

Thanks!
The_Phi
 
Posts: 2
Joined: Thu Nov 07, 2019 9:37 am

You'll need to use separate conditions. Look up "nested conditions" in the help for more info on how to do this.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Well, I'm already using a nested condition here.
Image

I try to fill a custom text named "Betreff". In a first step I'm looking for "Jahresrechnung". This works fine:
Image

The "riddle" I have to solve:
Now I could add another "Contains match" looking for "Gas".
Image

If I test this, the conditions 2 ("Jahresrechung") and 3 ("Gas") are matched.
Image

What I don't get here:
The content of "Betreff" after matching condition 2 is "Jahresrechnung" which is exactly what I've expected.
But why is it still "Jahresrechung" after machtching condition 3 ("Gas"). From my point of view the actual content should either be replaced by "Gas" or "Gas" should be added to the content. Something like variable = variable + new text.

Image

My goal is to have one custom text which contains a combined text which is built from several conditions.

Any advise?
The_Phi
 
Posts: 2
Joined: Thu Nov 07, 2019 9:37 am

If you re-use a custom attribute, the first time it is matched, it retains that value and subsequent uses of it have to match that.

If you want to match multiple things and have them be distinct, you need to use separate custom attributes. You can then combine them later by listing them all.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron