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

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 Leaders.
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

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events