Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
PepsiHog
- Automation Wizard
- Posts: 517
- Joined: Wed Apr 08, 2009 4:19 pm
- Location: Florida
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 2024) 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!
-
JRL
- Automation Wizard
- Posts: 3530
- Joined: Mon Jan 10, 2005 6:22 pm
- Location: Iowa
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%
-
PepsiHog
- Automation Wizard
- Posts: 517
- Joined: Wed Apr 08, 2009 4:19 pm
- Location: Florida
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 2024) 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!
-
Grovkillen
- Automation Wizard
- Posts: 1132
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
-
Contact:
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...
-
PepsiHog
- Automation Wizard
- Posts: 517
- Joined: Wed Apr 08, 2009 4:19 pm
- Location: Florida
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 2024) 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!