RegEx Case Insensitive

Post Reply
ace27rsm
Newbie
Posts: 11
Joined: Sat Aug 18, 2018 11:06 pm

RegEx Case Insensitive

Post by ace27rsm »

Hi everyone,
i'm trying to make a switch in a flow using regex matching on job.name.

for example

if i have a job called 123.MICKEY

and the regex .*MICKEY.*

There is the match
but if i use .*mickey.* it is not

this is because MICKEY in job.name is UPPERCASE....

so, i look at the the reference guide i saw that using /.*mickey.*/i there would be the match for all cases

But it seems that this syntax won't work on switch, neither the /.*MICKEY.*/i match the job.name now.

Any help?

thank you
freddyp
Advanced member
Posts: 1022
Joined: Thu Feb 09, 2012 3:53 pm

Re: RegEx Case Insensitive

Post by freddyp »

/regex/i is something you use in scripting. You do not specify it but I am assuming you are using a condition with variables with [Job.Name] on the left-hand side "Matches" as an operator and the regular expression on the right-hand side. Assuming I am right, what you need to do is this: convert the job name to lowercase using the feature in the variables pane so you get [Job.Name:Case="lower"], operator "Matches", regex: .+mickey
You can of course also convert to uppercase and match .+MICKEY
ace27rsm
Newbie
Posts: 11
Joined: Sat Aug 18, 2018 11:06 pm

Re: RegEx Case Insensitive

Post by ace27rsm »

Hi Freddy thank you so much for your help.

yes i'm using the command "define condition with variables.
It works, forcing the job.name to upper o lower case the file matches.

Thank you again

bye
web3dprint
Newbie
Posts: 8
Joined: Fri Feb 26, 2016 5:04 pm

Re: RegEx Case Insensitive

Post by web3dprint »

Thanks freddyp, that's a good tip! While it is a relatively simple workaround, a dedicated flag — maybe a checkbox or separate option like "matches (case insensitive)" — would be easier to find, just saying :)
Post Reply