Reputation: 2961
I'm trying to find two different regex for the following string:
eturk/clock, eturk/vermonster, and noted/noted#42
One of the regex should recognize just the repo (without the issue). So for the first regex, it should just return these matches:
[["eturk", "clock"], ["eturk", "vermonster"]]
And then for the second one, it should recognize the issue along with the repo. So the match would be:
[["noted", "noted", "42"]]
This is what I have so far for the first part:
/(\w*)\/(\w*)?/
This would match like this:
[["eturk", "clock"], ["eturk", "vermonster"], ["noted", "noted"]]
But the thing is, I don't want it to match the reference to the repo with the issue attached. Can anyone offer any help on this?
Upvotes: 2
Views: 275