Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHDERUPTENFRES

Elysia Tools

Navigation

Development

Regular Expression Examples: Format and Boundary Tests

Test usernames, dates and IPv4 patterns with positive and negative examples.

Samples

Entries inside this sample collection

TextIntermediate

Email Address

Validate email addresses format

Tags

regex, regular-expression, pattern, validation, email, contact

plaintext
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
TextIntermediate

URL / Web Address

Match HTTP/HTTPS URLs

Tags

regex, regular-expression, pattern, validation, url, web, http, https

plaintext
^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$
TextIntermediate

IPv4 Address

Validate IPv4 addresses

Tags

regex, regular-expression, pattern, validation, ip, ipv4, network

plaintext
^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
TextComplex

IPv6 Address

Validate IPv6 addresses

Tags

regex, regular-expression, pattern, validation, ip, ipv6, network, advanced

plaintext
^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]+|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9]))$
TextSimple

ISO Date Format (YYYY-MM-DD)

Validate ISO 8601 date format

Tags

regex, regular-expression, pattern, validation, date, iso, format, basic

plaintext
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
TextSimple

24-Hour Time Format

Validate time in HH:MM format

Tags

regex, regular-expression, pattern, validation, time, 24h, format, basic

plaintext
^([01]\d|2[0-3]):[0-5]\d$
TextIntermediate

US Phone Number

Match US phone number formats

Tags

regex, regular-expression, pattern, validation, phone, us, contact

plaintext
^(\+?1[-.\s]?)?\(?[0-9]{3}\)?[-.\s]?[0-9]{3}[-.\s]?[0-9]{4}$
TextSimple

Username

Validate username (alphanumeric, underscore, hyphen)

Tags

regex, regular-expression, pattern, validation, username, user, account, basic

plaintext
^[a-zA-Z0-9_-]{3,16}$
TextIntermediate

Strong Password

Validate strong password (min 8 chars, uppercase, lowercase, number, special)

Tags

regex, regular-expression, pattern, validation, password, security

plaintext
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
TextSimple

US Postal Code (ZIP)

Validate US ZIP code format

Tags

regex, regular-expression, pattern, validation, postal, zip, us, basic

plaintext
^\d{5}(-\d{4})?$
TextComplex

Credit Card Number

Match major credit card numbers

Tags

regex, regular-expression, pattern, validation, credit-card, payment, financial, advanced

plaintext
^(?:4[0-9]{12}(?:[0-9]{3})?|(?:5[1-5][0-9]{14}|2(?:2[2-9][0-9]{2}|[3-6][0-9]{3}|7(?:[01][0-9]{2}|20[0-9]))[0-9]{12})|6(?:011|5[0-9]{2})[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$
TextSimple

Hexadecimal Color Code

Match hex color codes (#RGB or #RRGGBB)

Tags

regex, regular-expression, pattern, validation, color, hex, css, basic

plaintext
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
TextIntermediate

US Social Security Number

Validate SSN format

Tags

regex, regular-expression, pattern, validation, ssn, us, identification

plaintext
^(?!000|666)[0-8]\d{2}-(?!00)\d{2}-(?!0000)\d{4}$
TextIntermediate

HTML Tag

Match HTML tags

Tags

regex, regular-expression, pattern, validation, html, tag, web

plaintext
^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$
TextSimple

Integer Number

Match positive/negative integers

Tags

regex, regular-expression, pattern, validation, number, integer, basic

plaintext
^-?\d+$
TextSimple

Decimal Number

Match decimal numbers with optional sign

Tags

regex, regular-expression, pattern, validation, number, decimal, basic

plaintext
^-?\d+(?:\.\d+)?$
TextIntermediate

UUID / GUID

Validate UUID format

Tags

regex, regular-expression, pattern, validation, uuid, guid, identifier

plaintext
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
TextIntermediate

MAC Address

Validate MAC address format

Tags

regex, regular-expression, pattern, validation, mac, network, hardware

plaintext
^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$

Tools

Tools frequently paired with this sample

Related

Related sample collections

Related

Related workflows

Tool usage guide

Sample-focused context for search and workflow understanding

Overview

A regex match means the input follows one expression’s character pattern. It does not automatically prove that a date exists, an address is reachable or a value meets business rules. Choose a pattern, test its boundaries and verify it in the target runtime.

Choose a pattern

Cards display expression text that you can copy into your own regex tool or program. Use the username pattern for length, the date pattern to distinguish syntax from calendar validity, and the IPv4 pattern for numeric ranges.

The anchors ^ and $ constrain the match boundaries. Exact matching, escaping and available syntax depend on the language, engine and flags; string literals may need an extra layer of escaping.

Choose a pattern
Sample cardUse
UsernameCharacter and length rules
ISO Date Format (YYYY-MM-DD)Date shape versus calendar validity
IPv4 AddressIPv4 octet ranges

Include failing cases

Prepare inputs that should match and should fail. Validate separate requirements such as real calendar dates, business date ranges and network policy separately, and inspect how the target program reports errors.

How it works

  1. 1Copy the expression from the relevant card.
  2. 2Run both positive and negative inputs in the target engine.
  3. 3Validate business meaning separately and record engine and flags.

Edge cases & common failures

  • Engine differences

    Escaping, Unicode, anchors and multiline flags can vary; retest in the deployment environment.

  • Sensitive data

    Use synthetic values instead of pasting real passwords or sensitive information into an untrusted online tester.

Examples

1. Username length

How to use

Copy the “Username” card expression and test abc and ab with JavaScript RegExp.

Outcome

abc matches and ab does not. The rule allows 3–16 ASCII letters, digits, underscores or hyphens.

2. Date syntax versus a real date

How to use

Copy the “ISO Date Format (YYYY-MM-DD)” card expression and test 2024-02-31 and 2024-13-01.

Outcome

The first matches and the second does not. The expression checks numeric month and day ranges, not the actual number of days in February; use calendar validation too.

3. IPv4 segment ranges

How to use

Copy the “IPv4 Address” card expression and test 192.168.1.1 and 256.1.1.1.

Outcome

The first matches and the second does not. The pattern limits segment values; it does not prove reachability or compliance with network policy.

Hub

UI Screenshot Structure Review and Development Handoff

Turn one authorized UI screenshot into a manually reviewed component tree, validated JSON and development notes, with source coordinates, uncertainty and revision evidence preserved.

Hub

Regex Testing, Visualization, and Safety Workflow

Build reliable regular expressions by learning syntax, testing matches, visualizing structure, previewing replacements, benchmarking alternatives, and scanning for ReDoS risk.

Hub

API Mock Fixture Generation and Review

Build repeatable mock payloads, generate format-valid edge values, catch confusing field names, and review a temporary mock service before sharing it with a development team.

Hub

Texture, Grain, Pattern, and Reflection Overlays for Images

Dress a finished image with material character — mask where the effect applies, add film grain or surface texture, overlay geometric patterns, and extend the composition with water reflections.

Home
Tools3212
Samples593
Visualizations471
Viewers103
Hubs239
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance647

Calculators, numerics, date logic, statistics, and finance tools

Design & Color298

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web193

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

Lead Generation Quiz Launch and Contact Handoff
Memorial Drafts: Family Review and Print Handoff
Private Habit Records: Backup, Restore and Sharing Review
Article to X and LinkedIn Drafts: Fact Review and Handoff
Markdown Interactive Deck Review and Offline Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact

Development

AI Regex Explainer

Use AI to break down regular expressions into readable explanations

Development

Glob to Regex

Convert file matching patterns (Glob) to regular expressions

Development

Regex Debugger

Step through how a regular expression matches a string position by position: visualize match attempts, partial successes, backtracks, and captures — a learning tool for understanding regex behavior, not just the final result

Development

Regex Linter

Detect error-prone and risky regex patterns, check for catastrophic backtracking, unanchored patterns, and provide rewrite suggestions

Development

Regex Replace Previewer

Preview regex replacements in real-time with detailed diff highlights and statistics

Development

Regex Tester

Test regular expressions against text

Development

Regex Railroad Diagram Visualizer

Render a regular expression as an SVG railroad (syntax) diagram showing literals, groups, alternations, and repetition, with capture-group numbering and flag explanations

Development

Regex to String Generator

Generate random strings that match a given regular expression pattern

Validation

Regex Pattern Alternatives

Multiple ways to write the same regex pattern with different trade-offs in readability, performance, and accuracy

Validation

Risky Regex Patterns

Collection of regex patterns that demonstrate security vulnerabilities, performance issues, and common anti-patterns to avoid

Text Processing

Regex Named Capture Groups

Collection of regex patterns using named capture groups for extracting structured data from text. Named groups make patterns more readable and maintainable by assigning meaningful names to captured portions.

Text Processing

Regex Replace Samples

Collection of common and useful regex replacement patterns for text transformation and data cleaning

Java

Android String Processing Java Samples

Android Java string processing examples including string split and join, regular expressions, and string replacement

Kotlin

Android String Processing Kotlin Samples

Android Kotlin string processing examples including string split and join, regular expressions, and string replacement