Riddle me this.....

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Riddle me this.....

Post by PepsiHog » Sun Dec 06, 2020 11:53 pm

Hello Everyone,

I don't need help with this per say. I just would like to know the answer to this riddle.

Line A works. Line B does not work. Why?

Code: Select all

let>Num=38
let>NumList=28;13;16;45;48;20;41;38;25;51;31;34;24;52;22;39;27;2;49;6;3;36;12;11;

let>PatternA=(\d\d?;?){1,3}
RegEx>PatternA,NumList,0,match,ResA,0

let>PatternB=((.*)?;?%Num%).*
RegEx>PatternB,NumList,0,match,nom,1,$1,PartList

// PartList=28;13;16;45;48;20;41;38

//Line A
RegEx>PatternA,PartList,0,MatchA,ResultA,0
//Line B
RegEx>(\d\d?;?){1,3},PartList,0,MatchB,ResultB,0

mdl>%ResultA%%crlf%%ResultB%%crlf%%ResA%%crlf%%PartList%
PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Riddle me this.....

Post by JRL » Mon Dec 07, 2020 1:49 pm

My guess is:
MS doesn't like the comma.

Code: Select all

let>Num=38
let>NumList=28;13;16;45;48;20;41;38;25;51;31;34;24;52;22;39;27;2;49;6;3;36;12;11;
let>PatternA=(\d\d?;?){1,3}
RegEx>PatternA,NumList,0,match,ResA,0
let>PatternB=((.*)?;?%Num%).*
RegEx>PatternB,NumList,0,match,nom,1,$1,PartList

// PartList=28;13;16;45;48;20;41;38

//Line A
RegEx>PatternA,PartList,0,MatchA,ResultA,0
//Line B
RegEx>{"(\d\d?;?){1,3}"},PartList,0,MatchB,ResultB,0
mdl>%ResultA%%crlf%%ResultB%%crlf%%ResA%%crlf%%PartList%

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: Riddle me this.....

Post by PepsiHog » Tue Dec 08, 2020 1:07 am

@JRL,

Huh? Thanks for the work around, but I don't understand. It's part of RegEx syntax. How can MS not like the comma? I am guessing you are referring to {1,3} coma. But that's the syntax. Plus I've used this before without this issue.

Am I misunderstanding?

[edit] - Normally I'd be happy with your answer JRL. But this is first day stuff. I am suppose to know RegEx. Your answer is just shoving a stick of dynamite in my pile of understanding and blowing it all to Hello. So please forgive me, but I need a second opinion.

Anyone? Second opinion?

PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Riddle me this.....

Post by Grovkillen » Tue Dec 08, 2020 9:15 am

We need to consult Marcus on how MS is parsing the RegEx internally. I think JRL is close to the truth though. Have you tried "let>PatternA=(\d\d?;?){1%COMMA%3}"? Just as a test...
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: Riddle me this.....

Post by PepsiHog » Tue Dec 08, 2020 7:15 pm

@Grovkillen,

Yes. And that works. I understand doing that for a long argument, but makes little sense to me for a short one.

Thanks to you and JRL for the help. I'd swear I've done this before with no problem, but maybe I'm wrong.

Correction. I've used a let>Pattern string with just the argument as is. And it works. I'll give that a try.

Thanks,
PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

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