Regular Expression on Incoming Mail Handler

Hi to all,

I need your help configuring an Incoming Mail Handler with Rex ex content exclusion.

I need to strip the text after the second occurrence of the word "From".

I have checked on https://regex101.com/ this regex 

/^(?:.*?\KFrom){2}|>/s

 

The result is the one I expected:

the original text is

From: XXXX 
Any text

From: YYYY
Any text

 

The result applying the regex is:

From: XXXX 
Any text

From: YYYY
Any text

 

The highlighted text is exactly the string after which I need to strip the content.

 

When I try to insert the above regular expression on JIRA Incoming Mail Handler nothing happens, the email content is not stripped and all it is used to create the comment on the issue.

 

Any idea?

 

Thank you in advance

Regards

Arianna

3 answers

This widget could not be displayed.

Mail handler uses Perl5 regex (Perl5Util to be precise) to split the the input by given regex. If the result has more than 1 elements the first one will be used (everything before the regex match) otherwise the original text is used. I'm not a perl regex expert myself but you would need to get your regex to work under perl5.

 

 

This widget could not be displayed.

Did you found a solution?

This widget could not be displayed.

Not yet... :( Any idea? Thank you

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 11 hours ago in Canada

AUG Lunch Roundtable - August 13 - Highlights

Thanks to everyone who came out today for the lunch AUG - we had some great food and discussion (and ice cream sandwiches to fend off the heat!) The welcome and fun fact was great as well, what an aw...

27 views 1 3
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you