RegEx

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

RegEx

Post by PepsiHog » Wed Mar 10, 2021 4:35 pm

Hello All,
Programming is not working for me today. This SHOULD be simple. Yet, no.

let>Number=0;1;

RegEx>\d[^0]......

I just want the two numbers in Number, except excluding the number if it is zero. Why is this impossible for me?

I have done like a billion freaking combinations.

Please help. (My wall has too many holes.)

With great appreciation,
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
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: RegEx

Post by PepsiHog » Wed Mar 10, 2021 5:39 pm

Ok,

I got it. I was doing this

RegEx>\d[1-7]

Thinking I was specifying a digit between 1 and 7. But [1-7] is a stand alone argument.

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: RegEx

Post by JRL » Wed Mar 10, 2021 7:24 pm

So... what was the solution?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Re: RegEx

Post by Bob Hansen » Thu Mar 11, 2021 5:59 pm

How about this, vs. RegEx?

Code: Select all

let>Number=0;1;
Separate>Number,;,vNumbersArray
MessageModal>Numbers are:%CRLF%%vNumbersArray_1%%CRLF%%vNumbersArray_2%
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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

Re: RegEx

Post by PepsiHog » Fri Mar 12, 2021 3:41 pm

@JRL,
The solution was to exclude \d.

RegEx>[1-7],string,0,match,nom,0

Originally I had \d[1-7] thinking I was specifying that the digit(\d) needed to be 1 through 7.

PepsiHog

We have a tattle tale right here. I think it's spying on us. It KNOWS how to add. This is getting SCARY!! 1,2,3,..
4! Four times edited! HaHaHa! (Sesame Street count)
5! Five times edited!
6! Six times edited!
7! Seven times edited!
Dang, it's keeping up!
Last edited by PepsiHog on Fri Mar 12, 2021 4:37 pm, edited 7 times in total.
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
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: RegEx

Post by PepsiHog » Fri Mar 12, 2021 3:54 pm

@Bob
Why not, not? :lol: The why is because I LOVE RegEx. I can get what I want with just one line. Plus, I have to think about Marcus. He introduced me to RegEx and I wouldn't want to let him down.

Also, RegEx is mind bending, stimulating, bang your head against the wall, rip out your hair, finally get it, and quit programming because you're burnt out from trying to figure it out, FUN!

I mean, what more could you want?

PepsiHog

[Edit] - Also, Bob, when I post, I post examples, not real time programming. I try to keep it as simplistic as possible as to not confuse anyone about what I am trying to do. The 'number' in this case, is unknown. Plus, RegEx acts as a filter for results that are being ignored(In some cases).
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
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: RegEx

Post by PepsiHog » Sun Mar 14, 2021 5:49 pm

@JRL and Bob,
In my first post I was talking about excluding the number zero. This was something I was first trying to do. I then shifted to [1-7] which for this case worked, and was more simple.

My attention to detail when posting needs a little work. Sorry for that.

Thanks to both of you for helping me.
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