Hello,
We are using Bit bucket cloud for our deployments. We have integrated Bitbucket with Jira Issues. Now we are planning to enforce commit strategies with Workflow Links Regex.
We are using regex value as : ^[KL]{2}-\d{4,9}: .*
Expected commit pattern should strictly follow below pattern as :
KL(hyphen)1655(colon)(space bar)first commit message.
In our case it is not working.
Can someone suggest best way to write regex for the same.
Thanks And Regards
I can't help you with Workflow Links, but as for the regex:
Your pattern will match any combination of K or L at the beginning - KK, LL, KL, LK.
If you want a literal "KL" then you can use this instead: ^KL-\d{4,9}: .*
Hi FrankyG,
Thanks for responding.
In my case, we wanted to enforce users to follow below pattern
KL(hyphen)1655(colon)(space bar)first commit message.
For eg : if a user fails to provide space bar in between colon and commit message(i.e KL-1622:Some Commit Message) it should not be allow as valid commit since we have strictly mentioned/enforced space bar in regex.
In my case, this enforcement is not working.
It would be helpful if you suggest some regex pattern for the same.
Thanks and Regards,
Siddhesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Siddhesh,
That regex should do what you expect. I'm not familiar with Workflow Links, so there might be something going wrong there.
I've tested the regex with some examples here: regexr.com/5bbdk (look at the Tests tab and note which tests are "Match full" and which are "Match none")
The only other thing I'd suggest is that this doesn't enforce a message after the space, which can be done with + (1 or more) instead of * (0 or more)
^KL-\d{4,9}: .+
Sorry I can't be of more help. Good luck!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.