RFC-1123 is based on RFC-952, which doesn't allow underscores. RFC-1123
must be therefore implemented with the same constraint to disallow
underscores in host names.
Fixes Or Enhances https://github.com/go-playground/validator/issues/518.
Make sure that you've checked the boxes below before you submit PR:
[x] Tests exist or have been written that cover this particular change.
Change Details:
The datauri validation was not allowing certain valid strings; this
commit updates the regex to meet RFC 2397. I drew heavily on this gist
https://gist.github.com/khanzadimahdi/bab8a3416bdb764b9eda5b38b35735b8,
but had to make a few updates to remove some negative lookaheads (which
Go doesn't allow afaik), and to account for the way the `isDataURI`
function works - it validates the base64 separately from the other parts
of the uri.
@go-playground/admins
rejects now properly test for RGB 255 and RGB using percentages, before it allowed mixing of percentages or numbers between 0-255 but it's either or now.
add rgb color validation function + Test Code
add rgba color validation function + Test Code
add hsl color validation function + Test Code
add hula color validation function + Test Code
add numeric validation function + Test Cases
add number validation function + Test Cases
add hexadecimal validation function + Test Cases
add hexcolor validation function + Test Cases
add email validation function + Test Cases