0

The default regex in Stash to match JIRA ID is

JVM_SUPPORT_RECOMMENDED_ARGS="-Dintegration.jira.key.pattern=\"((?<!([a-z]{1,10})-?)[a-z]+-\d+)\""

But it matches regardless where the JIRA ID's location.

I want it only matches from beginning:

  • JIRA-1 what ever: match!
  • something JIRA-1 else: not match

How to edit the regex?

Following don't work

\"^((?<!([a-z]{1,10})-?)[a-z]+-\d+)\"

and

\"(^(?<!([a-z]{1,10})-?)[a-z]+-\d+)\"

Solution:

^[a-z]+-\d+ will do.

valpa
  • 367
  • 1
  • 3
  • 14

1 Answers1

1

If you want to match the JIRA-<id> only from the beginning you should try:

\"^JIRA-(\d+)\"
Andrea Salicetti
  • 2,423
  • 24
  • 37