Skip to main content

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

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


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


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.


Hi

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


Hi

Do you have an example?


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.


Hi Michelle Goodman

Try this:

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


Reply