This is an inherited problem from every other validation library out there. This same regex keeps getting copied around.
Wikipedia gives a pretty clear guidance about what a valid Data URI is: data:[<media type>][;base64],<data> note the optional state of <media type> and even of the ;base64 element, and the requirement of a comma.
Package version eg. v8, v9:
master
Code sample, to showcase or reproduce:
Prints
false
it should printtrue
.This is an inherited problem from every other validation library out there. This same regex keeps getting copied around.
Wikipedia gives a pretty clear guidance about what a valid Data URI is:
data:[<media type>][;base64],<data>
note the optional state of<media type>
and even of the;base64
element, and the requirement of a comma.