echo "Log: PROJ-123 error" | grep -Eo '\b[A-Z]+-\d+\b' # Output: PROJ-123
Now you can confidently extract, validate, and manipulate Jira issue keys in any programming language or automation pipeline.
| Regex Engine | Pattern | Time (ms) | Backtracking steps | |--------------|---------|-----------|--------------------| | Python re | [A-Z]+-[0-9]+ | 12 | None (linear) | | Python re | [A-Z]+-\d+ | 11 | None | | JavaScript | \b[A-Z]+-\d+\b | 8 | None |
According to Atlassian’s documentation, a valid Jira issue key consists of:
When building automation scripts, log parsers, Git integrations, or custom search tools, you will inevitably need to .
Depending on where you are using the regex (e.g., Bitbucket integrations, Jira Automation, or custom scripts), you might need specific boundaries: Regex Pattern Strict (Default) ([A-Z][A-Z0-9]+-[1-9][0-9]*) Standard validation. Global Search ([A-Z][A-Z0-9]+-\d+) Finds keys anywhere in text (e.g., descriptions). Bitbucket Linker
Use the global regex with :
def is_valid_jira_key(key): return bool(re.fullmatch(r'[A-Z]+-\d+', key))
Based on Atlassian’s documentation and common implementation across their products (Jira Cloud, Data Center, Bitbucket, Bamboo), the for a single Jira issue key is:
echo "Log: PROJ-123 error" | grep -Eo '\b[A-Z]+-\d+\b' # Output: PROJ-123
Now you can confidently extract, validate, and manipulate Jira issue keys in any programming language or automation pipeline.
| Regex Engine | Pattern | Time (ms) | Backtracking steps | |--------------|---------|-----------|--------------------| | Python re | [A-Z]+-[0-9]+ | 12 | None (linear) | | Python re | [A-Z]+-\d+ | 11 | None | | JavaScript | \b[A-Z]+-\d+\b | 8 | None | jira issue key regex
According to Atlassian’s documentation, a valid Jira issue key consists of:
When building automation scripts, log parsers, Git integrations, or custom search tools, you will inevitably need to . echo "Log: PROJ-123 error" | grep -Eo '\b[A-Z]+-\d+\b'
Depending on where you are using the regex (e.g., Bitbucket integrations, Jira Automation, or custom scripts), you might need specific boundaries: Regex Pattern Strict (Default) ([A-Z][A-Z0-9]+-[1-9][0-9]*) Standard validation. Global Search ([A-Z][A-Z0-9]+-\d+) Finds keys anywhere in text (e.g., descriptions). Bitbucket Linker
Use the global regex with :
def is_valid_jira_key(key): return bool(re.fullmatch(r'[A-Z]+-\d+', key))
Based on Atlassian’s documentation and common implementation across their products (Jira Cloud, Data Center, Bitbucket, Bamboo), the for a single Jira issue key is: or custom search tools