I was able to get it to work by slightly changing your second attempt to:
"^\d{3}\-\d{3}$"
But maybe this is exactly what you tried? I noticed that my “\” in front of the “-” was removed in the post until I formatted it as code. Html problems.’’
Here’s the full expression I set in an argument/variable widget:
FYI - I use https://regex101.com/ or https://www.regextester.com/ (or any of the multitude available) to test a number of variations of sample data against an expression. It’s an easy way to tell if you’re expression is solid.
Gotcha. In-Trans v Pre-processing shouldn’t matter in this case. I was just testing mine in a data directive (rather than method).
First, change your variable name from “Regex” to “regex” or “regexTest”. Regex with a capital R is the class you’ll use that has that isMatch method, and you will confuse things naming the variable the same thing (sorry for the confusion).
I’m not familiar with your version (your profile says 10.2.300 btw), but you should be able to add the "using"s via a custom code block. You may need to connect the empty code block you add these usings to (and put in the beginning after the start widget), but I’m not sure.
If you don’t have access to the custom code widget, you’ll need the “BPM Advanced User” checkbox checked in the user account security maintenance module to get it.
I tried the option Calvin suggested, as it is the “easier” one, but this did not work either. However, me being cautious I decided to try the same logic in the TRAINING database:
RESULT ~ it works as expected
I will double check all the other suggestions in the same database and post the results.
Now I have to raise a support ticket to discover why it does not work in our LIVE environment. I will also update this information to the discussion when it is available.
Hi @ckrusen,
yes of course my variable is defined as boolean because the output from this function is boolean i.e. true or false, and this apply to @Asz0ka solution as well, i just confirmed that this function/method will do the job, i have tested it within Epicor and outside C#/.NET running app, the only different is the backslash position and number.
also the function does not required to add any using to the class it is already defined within the std class called subroutine (code library), at least in my version.
Thanks all for the contrributions, I now has enough information to resolve the issue:
The following grid shows which of the strings work
The reason that the strings would not work in the LIVE database is so simple I cannot believe I missed it:
The condition phrase must use the “matches” option.
The “equal to” option does NOT work.
So in summary a screenshot to show all relevant info: