Regex behavior incorrect for 'hints' kitten? #4614
Replies: 3 comments 2 replies
|
Shortly after posting I noticed this comment in the documentation for the hints kitten:
So, I suspect this has something to do with my problem, but I don't know how to work around it. I've tried nested groups, but that didn't work either. |
0 replies
|
...figured it out, reading closer -- it's an implicitly numbered groups. Using a named group works as expected:
|
1 reply
|
(?:PROJ|BUGS)\-[0-9]+
|
1 reply
Answer selected by
rexkerr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Before I submit an issue or try to fix this myself I thought it would be good to get clarification to make sure that I'm not just overlooking or misunderstanding something.
I'm trying to use the hints kitten to map a keystroke to open Jira tasks referenced in git history in the browser. Let's assume that I have two Jira projects, one named PROJ and one named BUGS, and our tickets are in the form of PROJ-#### or BUGS-####. I wrote the following marker, and it works as expected:
I then tried to make a hints mapping that runs an existing script that converts the task ID into the full URL, but it doesn't match the same thing:
As you can see from the bold-face text, it only matches the part in the capture group, not the full regex. I suspect that the hints kitty is using its own mechanism to perform the regex match different than the build-in regex match used by the marker.
I can work around this, and it does what I want it to do, by expanding the regex and duplicating the
-[0-9]+portion over and over, but it makes for an uglier expression.All reactions