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

Question

Question

patterns

asked on October 13, 2016 Show version history

I am new to workflow and patterns.... and I'm having a hard time figuring out what expression I would use to grab the year from a field with the following format  YY-#### (16-0120).... the first 2 digits = the year.  I would like to use the two digits as a token.

This is what I have typed {/d/d}-/d* but it doesn't work.

Any help would be great

Paula

0 0

Replies

replied on October 13, 2016

Hi Paula,

If you only want the first two digits, you can write a pattern that only grabs two. Your current pattern has forward slashes, but you'll need backslashes. Here's what I wrote to grab 2 digits from the field: \d{2}. You can also write this as \d\d.

This will take the first 2 digits no matter the rest of the input, so if you need to narrow it down more, you may want to write a pattern that matches your whole value. An example of this would be (\d\d)-\d*, where the parentheses specify which part you want to keep as your token.

For more info on regular expressions, you can refer to this help file. Hope this helps!

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

Sign in to reply to this post.