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

Question

Question

Assistance using regex in workflow to grab all characters after a CRLF.

asked on January 16

Greetings,

I have a workflow (version 11.0.2306) that retrieves a field value that contains sixteen characters, a CRLF, then some number of characters that appear after the CRLF (on the new line).  I created a token to try to capture the characters after the CRLF using a regular expression, but when the workflow runs the token winds up empty.  I tried using a regular expression that simply grabs everything after a CRLF.  I then tried to explicitly include the first 16 characters and then the CRLF.  No success.

I can see that the regular expression looks as expected when I use the "Click here to test the token" in the Token Dialog UI.

But when I use the "Test Expression" after clicking on the little pattern button next to the Apply Regular Expression field it comes up empty. 

It seems perhaps the regular expression really doesn't work if I believe the "Test Expression" over the "Click here to test the token".

Is there a regular expression I can use to achieve extracting the characters after a CRLF?

Best regards,

Jeff

0 0

Answer

SELECTED ANSWER
replied on January 17

I feel like whenever I have a problem with regex in LF I am expecting the wrong regex mode (options). So in this case I'll be explicit as I can:  ^\d+\r?\n(\d+)$. 

And just for funsies this one works also : \r?\n(\d+). Here I am saying I don't care whats on the first line, just give me the digits on the second line

0 0
replied on January 20

Thank you! I found that \r?\n(\d+) works in both the regex test areas and proved to populate the token as expected in the workflow.

0 0

Replies

replied on January 19

\r\n(\d+) would also do the same job and is a little simpler

0 0
replied on January 20

Thank you!

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

Sign in to reply to this post.