You are viewing limited content. For full access, please sign in.

Question

Question

Quick fields patter matching

asked on January 29, 2015

Hi there,

Is there a way to build a regular expression for pattern matching in a way that a have two tokens, and I want to name the documento after one of these two. Like I have a number that normally a get with this expression "\s+([A-Z][A-Z]\d+.[A-Z][A-Z])\s+\n", but some times because  the image is not that great i want to be able to get another field "\s+(\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d)\s+\n". So is it possible to combine this two expression?, like if i do not get the first expression than it gets the other as a document name?

 

0 0

Replies

replied on January 29, 2015

Hi Vitor,

 

You could send it to workflow and have it run the pattern matching activity twice, once with your first expression and then if the result is empty, run a second pattern matching with your second formula and then rename the document using the resulting token.

 

I imagine the OR operator in regular expression wouldn't apply in this use case because you don't always want to match your second expression, only if the first one doesn't find a match?

 

Cheers,

Carl

1 0
replied on February 5, 2015

There are a number of ways to do this in Quick Fields, but the most intuitive one to me is to use a Conditional process.

You could use the Conditional process to check if the pattern matching token from your first expression is empty. If it is, you'd run a Pattern Matching process with the second regular expression, and replace the original pattern matching token value with this new one. Now you have a single token that will contain the correct value in either case, so you'd use this token to set the document name. 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.