Allow `issuePrefixes` to be a RegEx
See original GitHub issueCurrently, I have to set a multitude of prefixes for all my projects, and it would be best if I could just allow a RegEx:
Actual: issuePrefixes: ['XCAF-', 'ELNEW-', 'CRES-']
Preferred: issuePrefixes: /[A-Z]+-/
Would be even better if we could just define what an issue is instead of just a prefix. That would allow for any system: /#(\d+)\b/
, /\b([A-Z]+-\d+)\b/
, /\b(\d+)\$/
, etc (notice the capturing group as well so it captures exactly what an issue is)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Regular expression for a JIRA identifier - Stack Overflow
I think, but can't verify, Jira truncates issue prefixes to 4 characters max. So the regex I did only allows 1-4 capital letters; ......
Read more >Regular Expression (Regex) Tutorial
(Range Expression): Accept ANY ONE of the character in the range, e.g., [0-9] matches any digit; [A-Za-z] matches any uppercase or lowercase letters....
Read more >An introduction to regular expressions - O'Reilly
The fullmatch() function will accept a regex pattern and an input string to test against. It will return a match object if a...
Read more >Regular expressions - JavaScript - MDN Web Docs
Regular expressions are patterns used to match character combinations in strings. ... Regular expressions have optional flags that allow for ...
Read more >Regular Expression Language - Quick Reference
This allows the regular expression engine to disambiguate language elements (such as * or ?) and character literals (represented by \* or ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, I’ll give it a shot this weekend
I’ve checked the issue prefix code, technically you can pass valid regex as a string and it will be converted into regex.
We are using JIRA for issues, the format is
JIRA-123
, butJIRA
part is usually project-specific, i.e.PROJA
orPROJB
, so passing-i "[A-Z]+-"
matches JIRA tickets.But, it also matches
J-I-R-A-1
, doesn’t matchJ-I-R-A
.I.e.
log.txt
conventional-commits-parser -i "[A-Z]+-" log.txt
will matchJIRA-123
: