Webflags: gi
Data URI
Match base64-encoded data URIs, including the MIME type and the base64 payload.
Try it in RegexPro →Available in
Pattern
regexengine-agnostic
data:[\w\/+\-.]+(?:;[\w=\-]+)*;base64,[A-Za-z0-9+\/=]+ (flags: gi)Raw source: data:[\w\/+\-.]+(?:;[\w=\-]+)*;base64,[A-Za-z0-9+\/=]+
How it works
Starts with data:, then a MIME type (word chars, slashes, plus, hyphen, dot), optional parameters, then ;base64, and the base64 payload (letters, digits, +, /, =).
Examples
Input
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAMatches
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
Common use cases
- •Inline image extraction from HTML/CSS
- •Bundle size auditing
- •Asset migration tooling
- •Security scanning for embedded payloads
Related patterns
HTTP Content-Type Header
WebParse the value of an HTTP Content-Type header, capturing the media type and optional charset.
CSS rgb() Color
WebMatch CSS rgb() and rgba() color functions, including an optional alpha channel.
HTML Comment
WebMatch HTML comments, including multi-line comments and empty ones.
HTML5 Color Input Value
WebValidate the value of an HTML5 `<input type="color">` — exactly 6 hex digits with leading hash.