You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The usual metacharacters are normal characters inside a character class, and do not need to be escaped by a backslash.
See demo here: Also see a suggestion for an alternative regexp. It allows to my knowledge all chars like dots (in tags, but not multiple in a row) and dashes, underscore etc in branch name/tags.
([^.]\.?)+(?!\.(?!\.))\.{3}([^.]\.?)+(?!\.) should imo match the desired urls.
([^.]\.?)+// match anything except a dot, and then a dot :)(?!\. // don't match something that has an extra dot(?!\.))// except if it has a third dot, then we are cool, let the first expression match all until ..., including single dots
\.{3}// the three dots([^.]\.?)+// same as first(?!\.)// simpler pattern for not matching two dots, don't need to check for 3 dots anymore
It's a bit funky with the negative lookahead inside the negative lookahead, but does the trick. It is needed to cancel out the first negative lookahead if it has a total of three dots.
The text was updated successfully, but these errors were encountered:
mokkabonna
changed the title
Url validator fails for shas with the number 3 in them
Url validator fails for compare url and shas with the number 3 in them
Dec 14, 2017
The expresstion:
[^\.{3}]
used in the compare url regexp does not mean what I think you assume it means.I assume you mean: match anything that does not match three dots in a row.
What it does mean is: match anything but: period, {, 3, }
Also the \ isn't needed when inside a character set
https://www.regular-expressions.info/charclass.html
See demo here: Also see a suggestion for an alternative regexp. It allows to my knowledge all chars like dots (in tags, but not multiple in a row) and dashes, underscore etc in branch name/tags.
https://jsfiddle.net/4ros0p8d/3/
([^.]\.?)+(?!\.(?!\.))\.{3}([^.]\.?)+(?!\.)
should imo match the desired urls.It's a bit funky with the negative lookahead inside the negative lookahead, but does the trick. It is needed to cancel out the first negative lookahead if it has a total of three dots.
The text was updated successfully, but these errors were encountered: