Hello,
I think there is a problem in this regex or maybe all of them:
import re
pattern = r'https://(?P<domain>.+)/(?P<owner>.+)/(?P<repo>.+?)(?:\.git)?$'
url = 'https://github.com/nephila/giturlparse/blob/master/giturlparse/platforms/github.py'
match = re.match(pattern, url).groupdict()
I suppose, this is an invalid URL, for simple reason git clone would not accept it; however, when we check the match object, things are a bit strange,:
I don't know whether I'm right or not, but I think it's not normal to see a / in repo field, is it?
If it is not, so you guys should return False for valid attribute, am I right?
Is there any harm to make all the patterns non-greedy? Is there any circumstances that there would be '/' in the repo field?
Hello, I think there is a problem in this
regex
or maybe all of them:I suppose, this is an invalid URL, for simple reason
git clone
would not accept it; however, when we check the match object, things are a bit strange,:If we make them non-greedy, it would a little better:
/
in repo field, is it? If it is not, so you guys should returnFalse
forvalid
attribute, am I right?@yakky