# Common Regex Patterns

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

> Canonical page: https://test.elysiatools.com/en/samples/regex-samples

- **Category:** Development

- **Keywords:** regex, regular expression, pattern, validation, matching

## 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.

## Examples

- **Email Address**: Validate email addresses format
- **URL / Web Address**: Match HTTP/HTTPS URLs
- **IPv4 Address**: Validate IPv4 addresses
- **IPv6 Address**: Validate IPv6 addresses
- **ISO Date Format (YYYY-MM-DD)**: Validate ISO 8601 date format
- **24-Hour Time Format**: Validate time in HH:MM format
- **US Phone Number**: Match US phone number formats
- **Username**: Validate username (alphanumeric, underscore, hyphen)
- **Strong Password**: Validate strong password (min 8 chars, uppercase, lowercase, number, special)
- **US Postal Code (ZIP)**: Validate US ZIP code format
- **Credit Card Number**: Match major credit card numbers
- **Hexadecimal Color Code**: Match hex color codes (#RGB or #RRGGBB)
- **US Social Security Number**: Validate SSN format
- **HTML Tag**: Match HTML tags
- **Integer Number**: Match positive/negative integers
- **Decimal Number**: Match decimal numbers with optional sign
- **UUID / GUID**: Validate UUID format
- **MAC Address**: Validate MAC address format

## How it works

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

## Related tools

- [AI Regex Explainer](https://test.elysiatools.com/en/tools/ai-regex-explainer): Use AI to break down regular expressions into readable explanations
- [Glob to Regex](https://test.elysiatools.com/en/tools/glob-to-regex): Convert file matching patterns (Glob) to regular expressions
- [Regex Debugger](https://test.elysiatools.com/en/tools/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
- [Regex Linter](https://test.elysiatools.com/en/tools/regex-linter): Detect error-prone and risky regex patterns, check for catastrophic backtracking, unanchored patterns, and provide rewrite suggestions
- [Regex Replace Previewer](https://test.elysiatools.com/en/tools/regex-replace-previewer): Preview regex replacements in real-time with detailed diff highlights and statistics
- [Regex Tester](https://test.elysiatools.com/en/tools/regex-tester): Test regular expressions against text
- [Regex Railroad Diagram Visualizer](https://test.elysiatools.com/en/tools/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
- [Regex to String Generator](https://test.elysiatools.com/en/tools/regex-to-string-generator): Generate random strings that match a given regular expression pattern

## Related content

- [Regex Pattern Alternatives](https://test.elysiatools.com/en/samples/regex-alternatives): Multiple ways to write the same regex pattern with different trade-offs in readability, performance, and accuracy
- [Risky Regex Patterns](https://test.elysiatools.com/en/samples/risky-regex): Collection of regex patterns that demonstrate security vulnerabilities, performance issues, and common anti-patterns to avoid
- [Regex Named Capture Groups](https://test.elysiatools.com/en/samples/regex-named-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.
- [Regex Replace Samples](https://test.elysiatools.com/en/samples/regex-replace): Collection of common and useful regex replacement patterns for text transformation and data cleaning
- [Android String Processing Java Samples](https://test.elysiatools.com/en/samples/android-string-processing-java): Android Java string processing examples including string split and join, regular expressions, and string replacement
- [Android String Processing Kotlin Samples](https://test.elysiatools.com/en/samples/android-string-processing-kotlin): Android Kotlin string processing examples including string split and join, regular expressions, and string replacement
