Page 1 of 1

Select spot color by regular expression

Posted: Thu Jul 18, 2019 8:28 am
by derkolarsky
Hello everyone…

I'm new to this forum and hope to find some hints for daily problems that I can't solve by myself.

Starting of with this problem: I want to create an action that selects spot color with names like "Laser", "Laser text", Lasertext" or "Personailzation".
I've found out that (maybe one way of many) I can use this regex code:

Code: Select all

/\b(laser.*|perso.*)/gi
but is there a different way to format this code within an action list?

Yes I know, I can also name the spot colors "by name" and add more with the OR statement but I wanted to give regex a try…

Anyone can help?

Thanks in advance
Ralf

Edit Found a solution: I'm using

Code: Select all

\b(Lase.+|lase.+|Pers.+|pers.+)
but haven't figured out if there's a flag that works case insensitive, i.e.

Code: Select all

\b(lase.+|pers.+)
to slim it a bit more… ;)

Re: Select spot color by regular expression

Posted: Thu Jul 18, 2019 1:12 pm
by derkolarsky
Okay… I've got some help and that's what worked perfectly as I wanted to:

Code: Select all

\b((L|l)ase.+|(P|p)ers.+)
So if this is maybe useful for one of you guys… :)

Re: Select spot color by regular expression

Posted: Wed Apr 15, 2020 3:07 pm
by Stephen_A_Marsh
Case insensitive: (?i)

Code: Select all

(?i)laser
would select:

laser
Laser
LASER
lASER
etc.

Re: Select spot color by regular expression

Posted: Thu Apr 16, 2020 3:38 pm
by Terkelsen
If you like to play around with regular expressions, thats fine, but there is already a standard action in PitStop that will let you select spot colours from a list and it can even be case insensitive :-)
Skærmbillede 2020-04-16 kl. 15.33.32.png
Skærmbillede 2020-04-16 kl. 15.33.32.png (39.77 KiB) Viewed 5314 times