I have workflow with a text variable, which looks similar to that:
I'm interested in the first part, which is the "Settlement Date" as well as the number with the sign that is following the text. I have came up with the following regular expression:
It has two capturing groups, that should capture the parts I want. When I run the regex with this value in a C# console application, I get 3 groups:
But when I run the same expression in "Regular expression" action in workflow, only one group is extracted, and it's the complete value of the input text:
Is it possible to use use capturing groups in Nintex? If not, then only solution would be to split the operation into two actions - one extracting the first part, and second for the number with sign?
I am also having some issues with Nintex Regular Expressions. I am trying to test a URL to determine the folder depth after the library and while my regular expression works as expected in this tester .NET Regex Tester - Regex Storm , in Nintex it finds a match where it shouldn't. Just to share my test, I did.
Input: (https://sp.mycompany.com/Marketing/Documents/1/2/3/ ) should match
(https://sp.mycompany.com/Marketing/Documents/1/2/) Should not match, but it does.
Maybe someone from Nintex can reply with some details about regular expressions.
you probably used extract operation in workflow action. that's I think correct since your expression explicitelly matches 'b' character.
you can reference matching (sub)groups and if you did that you could see they match exactly what you need
if you are not sure about position of your specific group, you can as well name it
reg. match/not match of: https://sp.mycompany.com/Marketing/Documents/1/2/
I think, your first \w+ matches 'Documents', your second \w+ matches '1' and your third \w+ matches '2'.
then your input string ends, so there is not match for at least one non-white space charcter aka \S+
aah, I'm sorry, I uderstood it you want to match it.
if I test it on my env. it as well doesn't match.
but, one point to be sure. how do you want to treat parentheses in your strings?
I have tested myself everything without surrounding parentheses.
so, does your input string really contain a parentheses chars at the beginning and at the end of string?
do you want your regular expression to match these parentheses in input string or should they make up a subexpression in regex?
No my input string is the content item url. I am trying to create a regular expression to identify if a folder is created with more than 2 levels of depth. So I want the parenthesis to capture the string if there is a match. I didn't think this should match but it seems it is matching.
I affraid you just misinterpreted the result.
here is what docu says about 'replace text' operation:
since in this case your regex didn't match the pattern in input string, it didn't find anything what to replace - so you just see untouched input string.
you can check it with whatever input
reg. your target, if you just need to proof-check there are more then 2 levels (and do not need to know exact path) your better option might be 'check match' operation