Nintex Regular expression - How do you say \stop\"?"


Badge +8

Hi

I am trying to extract text from a multiple line column.

I am using a regular expression nintex action.

The multiple line text column it includes the text: Date_of_Request_dd_MMM_YYY_06MAR2017Number....etc..... What I want is to pull is only the date ie 06MAR2017. How do I say stop after the year. At the moment it pulls every starting Date_of_Request onwards.

I have use a reg ex pattern of Date_of_Request_dd_MMM_YYY_d{2}w+d{4}

Then update item - date of request column

Then I have a reg ex to remove Date_of_Requaest_dd_MMM_YY_

Then update item - date of request column Please advise. Thanks in advance


12 replies

Badge +8

Try this:

200816_pastedImage_1.png

Badge +8

Hi Michelle Goodman‌,

Why not use the inline function "Substring" and the action "Build string". It looks like the characters are set at fixex positions.

Cheers,

Rick

Userlevel 3
Badge +9

This is a good site (RegExr: Learn, Build, & Test RegEx ) to practice getting the right RegEx pattern.  I often go here to figure out the pattern I need before configuring the RegEx action in Nintex. 

Badge +8

Hi Rick

How would I set this up?

Badge +8

Hi All

I have another text string I want to pull. For this one there is no set length of characters. Therefore I can't say end after the 4 digits. Any ideas?

Userlevel 7
Badge +11

Hi Michelle,

Can you post the entire piece of text, and highlight the bit that you want to extract?

Cheers,

Vadim

Badge +8

Hi Vadim Tabakman/all

I managed to sort this one, but I have a new one to sort.

So I have:

Input text: word 1 day_03-22-2018_2051332_words

I just want the extract only this part "2051332".

What pattern do I need?

Userlevel 7
Badge +11

Hi Michelle,

is that number always going to be 7 digits?  Is there a chance there will be 7 digits anywhere else in that piece of text?

Vadim

Userlevel 7
Badge +11

If that's the only string of 7 digits, you can use this :

d{7}

You can test it here: https://regexr.com/3n36b 

Badge +8

Yes - thank you!

Badge +8

‌. What would I do if there were two strings with 7 digits, and I only want to pull the 1st match?

Userlevel 7
Badge +11

You could still use the same Regular Expession, store it in a Collection variable and then use the Collection Operation action to "Get" the data in the first spot in the collection, into a text variable.

Reply