Using or in an easypattern

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Using or in an easypattern

Post by kpassaur » Mon Mar 30, 2020 8:57 pm

This is so simple but I just can't get it today. I want to use "or" in an easypattern such as this:

Let>text=ABC456123
Let>pattern=ABC[6digits] or XYZ[6digits]
RegEx>pattern,text,1,matches,num,0
MessageModal>matches_1

Now the text could be XYZ456789 or TGO852369 etc. In other words it would not be [3letters][6digits] but 3 certain letters followed by 6 digits.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Using or in an easypattern

Post by Marcus Tettmar » Tue Mar 31, 2020 11:24 am

Try this:

Let>pattern=["ABC" OR "XYZ"][6digits]
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Re: Using or in an easypattern

Post by kpassaur » Tue Mar 31, 2020 11:44 am

Thank you

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

EasyPattern Failing

Post by kpassaur » Fri Apr 03, 2020 2:14 pm

I'm missing something here as the sample below just brings back the "W".
What I really want is the choice of "C" or "WEB" or "EDI" followed by 6 digits which I thought would be
["C" or "WEB" or "EDI"][6digits]


Let>text=WEB007029

Let>pattern=["WEB" or "EDI"]
RegEx>pattern,text,0,matches,num,0
MessageModal>matches_1

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Got it

Post by kpassaur » Fri Apr 03, 2020 2:23 pm

Sorry, didn't catch the 0 and 1 in the EasyPattern syntax

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts