Last active
December 16, 2024 15:00
-
-
Save RJ/fe728f939cdf1227457100fd6185e221 to your computer and use it in GitHub Desktop.
edgegap container image path regex bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
^(?:(?=[^:\\/]{4,253}) # Optional registry (non-capturing group) | |
(?!-) # Ensure no leading dash | |
[a-zA-Z0-9-]{1,63} # Allow alphanumeric and dashes (max 63 chars) | |
(?<!-) # Ensure no trailing dash | |
(?:\\.(?!-) # Allow dot-separated components, no dash after dot | |
[a-zA-Z0-9-]{1,63} # Same 63-char alphanumeric and dash rules | |
(?<!-))* # Zero or more of these subcomponents | |
(?::[0-9]{1,5})? # Optional port (e.g., :5000) | |
/)? # End of optional registry | |
((?![._-]) # Start repository (capturing group 1) | |
(?:[a-z0-9._-]*) # Allow alphanumeric, dot, underscore, dash (optional) | |
(?<![._-]) # Ensure no trailing . _ or - | |
(?:/(?![._-]) # Sub-paths separated by /, no leading . _ - | |
[a-z0-9._-]*(?<![._-]) # Same rules for sub-paths | |
)*) # Zero or more sub-paths | |
(?::(?![.-]) # Optional tag (capturing group 2) | |
[a-zA-Z0-9_.-]{1,128} # Alphanumeric, dot, underscore, dash (1–128 chars) | |
/?$ # Ensure proper path termination | |
``` | |
**Line 13 and 16 should allow capital letters too** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment