The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the "stash.jira.key.pattern" regex use lookbehind?

MattS
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 Champions.
November 3, 2015

https://confluence.atlassian.com/display/BitbucketServerKB/Integrating+with+custom+JIRA+issue+key gives a regex to use in BBS (Stash) for issues keys such as ABC-123

((?<!([A-Z]{1,10})-?)[A-Z]+-\d+)

But is lookbehind really needed in the pattern?

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 3, 2015

The lookbehind is used to ensure that a string like ABC-DEF-123 is not matched as DEF-123. Note that this type of pattern is used in Crucible review IDs and sometimes in Bamboo build keys.

TAGS
AUG Leaders

Atlassian Community Events