Page 1 of 1

RegEx Case Insensitive

Posted: Thu Apr 18, 2019 9:56 am
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

Re: RegEx Case Insensitive

Posted: Thu Apr 18, 2019 1:05 pm
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

Re: RegEx Case Insensitive

Posted: Thu Apr 18, 2019 4:22 pm
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

Re: RegEx Case Insensitive

Posted: Thu Apr 18, 2019 4:23 pm
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 :)