Skip to main content
Nintex Community Menu Bar

Regular expression - remove extra text in a column

  • Sep 1, 2017 11:21 AM UTC
  • 7 replies
  • 35 views
  • Translate All

Forum|alt.badge.img+9

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

7 replies

Forum|alt.badge.img+7

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

‌ ‌ ‌ ‌

Translate

Forum|alt.badge.img+7

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

Translate

Forum|alt.badge.img+9
  • Author
  • Rookie
  • Sep 1, 2017 2:06 PM UTC

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.

Translate

Forum|alt.badge.img+7

Hi ‌

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

Translate

Forum|alt.badge.img+7

Hi ‌

Do you have an example?

Translate

Forum|alt.badge.img+9
  • Author
  • Rookie
  • Sep 8, 2017 11:13 AM UTC

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.

Translate

Forum|alt.badge.img+7

Hi Michelle Goodman‌

Try this:

[sS]*(?=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 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

‌ ‌ ‌

Translate