For reference I use https://regex101.com/ with PCRE2 (PHP >=7.3) when I test my regexes. So this is a good start so you know your regex is corret. And as @emcodem points out, you don't need the regext start/stop slashes. However, you do need to set if you want case insensitive in the regex function. So your correct function would be: $regext("%s_original_name%","(?i)^dgtl_"). However, this function will extract the string as opposed to testing if it matches.
To test, just add a single conditional node and submit the source to it. Take a look at the two tests below. They do the exact same thing but with two different approaces. You CAN use both just for the heck of it but I think the first one match your usecase best.
Yes, it's help - this is what im looking for, this will help me to do more complexed conditionals with prefix, suffix and naming.
Thx!!!
But i find that %s_original_name% is read from file that monitored at the beginning of a WF, and i try to use $fname(%s_source%) from previous node in this case it's delivery, becouse at this point name and format are different from that on beginning, and i need to work with source of this point.
Just as sidenote, i would normally use the first line from steinar in a conditional, with one difference.
Instead of (?i)^dgtl_
I would probably use ^dgtl_|^DGTL_ but just because it is easier to read for me, functionally it is the same and the upper solution is more slick.
Thx!
For now a have only one question - how to findout filename of s_source from previous node. $fname(%s_source%) don't work as expected, or again - i do something wrong.
1st regex match of "$fname(%s_source%) = (?i)^dgtl_" is "$fname(\\ffast1\ffas_jobs\test_j\dgtl_1702.mxf) = (?i)^dgtl_"
2025-02-25_Remote Desktop Manager-005706.png (65.99 KiB) Viewed 2052 times