cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
michuk
Nintex Newbie

Regular expression - remove extra text in a column

Jump to solution

Hi 

I have populated a column with an email body. Now I need a regex to remove all the text from the column that I do not need. I only need the 1st few sentences of the email body.

What Reg ex can I use? Is there one that saids remove all text after a certain word?

Thanks

0 Kudos
Reply
7 Replies
paul_crawford
Nintex Newbie

Re: Regular expression - remove extra text in a column

Jump to solution

Hi

This should do what you want if there is a specific word you can use:

This will be stored in a collection variable and you can use the Get collection operation with an index of 0 to get the value you need. If you need more info see here:

Hope this helps

Reply
paul_crawford
Nintex Newbie

Re: Regular expression - remove extra text in a column

Jump to solution

Hi

You will need to create an Integer variable with a default value of 0 and use this in the index section of the collection operation

Reply
michuk
Nintex Newbie

Re: Regular expression - remove extra text in a column

Jump to solution

The reg expression result is ;

I have line breaks and spaces in the column I am pulling from. I not sure if this makes a difference.

0 Kudos
Reply
paul_crawford
Nintex Newbie

Re: Regular expression - remove extra text in a column

Jump to solution

Hi

Can you post an example of the original text and what you want as the result?

0 Kudos
Reply
paul_crawford
Nintex Newbie

Re: Regular expression - remove extra text in a column

Jump to solution

Hi

Do you have an example?

Reply
michuk
Nintex Newbie

Re: Regular expression - remove extra text in a column

Jump to solution

Hi Paul

I managed to do a work around. I think the issue might be a line break.

Example:

data 1: 123  Data 2: 123 Data 3:123

Data 4:123

Dear who ever...

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I want to remove the text from Dear onwards to leave only the data columns.

0 Kudos
Reply
paul_crawford
Nintex Newbie

Re: Regular expression - remove extra text in a column

Jump to solution

Hi Michelle Goodman

Try this:

[\s\S]*(?=Dear)

With the input text above, the result is

data 1: 123  Data 2: 123 Data 3:123

Data 4:123

 

;

You will have line breaks in it but you could do another regex set to replace, using the pattern \n and replacement text leave empty, which would remove the line breaks and you would have:

data 1: 123  Data 2: 123 Data 3:123Data 4:123 ;

Hope this helps

Reply