Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Regular Expression on Incoming Mail Handler

Arianna Fabbri
Contributor
July 31, 2015

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

0 votes
Arianna Fabbri
Contributor
August 30, 2015

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

0 votes
Andre Lehmann
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 25, 2015

Did you found a solution?

0 votes
Piotr Klimkowski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 31, 2015

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.

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Upcoming Jira Events