Regex Tester
Test regular expressions with real-time matching, capture group display, and flag toggles. Includes common patterns for email, URL, Ethereum addresses, and more.
Common Regex Patterns
Quick Reference
| Pattern | Meaning | Pattern | Meaning |
|---|---|---|---|
| . | Any character | * | 0 or more |
| \d | Digit [0-9] | + | 1 or more |
| \w | Word char [a-zA-Z0-9_] | ? | 0 or 1 |
| \s | Whitespace | {n,m} | Between n and m |
| ^ | Start of string | [abc] | Character set |
| $ | End of string | [^abc] | Negated set |
| (group) | Capture group | a|b | Alternation (or) |
About Regular Expressions
- Regular expressions (regex) are patterns used to match character combinations in strings
- g (global) finds all matches, i (case-insensitive) ignores case, m (multiline) makes ^ and $ match line boundaries, s (dotall) makes . match newlines
- Capture groups
()extract parts of a match. Named groups use(?<name>)syntax - This tool uses JavaScript's native RegExp engine and runs entirely in your browser
- Common web3 use cases: validating Ethereum addresses, parsing ABI signatures, extracting hex values from logs
How to Use This Regex Tester
This online regex tester lets you build, test, and debug regular expressions in real time. Whether you are validating user input, parsing log files, or extracting data from blockchain transactions, you can iterate on your pattern instantly without writing any code.
- Enter your regex pattern in the pattern input field. The tool supports standard JavaScript regex syntax including character classes, quantifiers, groups, and assertions.
- Paste or type your test string in the text area below. This is the content your regex will be evaluated against.
- Toggle flags such as global (g), case-insensitive (i), multiline (m), and dotAll (s) to adjust how the engine processes your pattern.
- View matches highlighted directly in the test string. Captured groups are displayed separately so you can verify that your pattern extracts the right data.
- Use preset patterns for common tasks like matching Ethereum addresses, email addresses, URLs, and IP addresses to save time.
All processing happens entirely in your browser. No data is sent to any server, making this tool safe for testing patterns against sensitive strings such as private keys, API tokens, or personal data.
Common Use Cases
- Input validation — Verify that form fields contain valid emails, phone numbers, URLs, or Ethereum addresses before submitting data.
- Log parsing — Extract timestamps, error codes, and transaction hashes from server or node logs using capture groups.
- Data extraction — Pull structured values like contract addresses, token amounts, or function signatures from raw blockchain data.
- Search and replace — Refactor code by finding patterns across files and replacing them with updated syntax or variable names.
- Solidity event parsing — Match and decode event signatures and indexed parameters from Ethereum transaction logs.
Related Tools
Frequently Asked Questions
What is a regular expression (regex)?
A regular expression is a sequence of characters that defines a search pattern. It is used in programming and text editors to find, match, and manipulate strings based on specific rules such as character classes, quantifiers, and anchors.
What is the difference between regex and simple string matching?
Simple string matching looks for an exact sequence of characters, while regex allows pattern-based matching with wildcards, repetition, optional characters, and alternation. Regex can match complex patterns like email addresses or IP addresses in a single expression.
What do the common regex flags (g, i, m, s) mean?
The 'g' flag enables global matching (find all matches, not just the first). The 'i' flag makes the pattern case-insensitive. The 'm' flag enables multiline mode so ^ and $ match line boundaries. The 's' flag makes the dot (.) match newline characters as well.
What are regex lookahead and lookbehind assertions?
Lookahead (?=...) and lookbehind (?<=...) are zero-width assertions that check if a pattern exists ahead of or behind the current position without consuming characters. For example, \d+(?= USD) matches digits only when followed by ' USD'.
Can I use regex to validate email addresses?
Yes, a common pattern is ^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,}$, though fully RFC-compliant email validation is extremely complex. For production use, combine a reasonable regex with server-side verification.
How does regex performance impact my application?
Poorly written regex patterns with excessive backtracking can cause catastrophic performance issues (ReDoS). Avoid nested quantifiers like (a+)+ and use atomic groups or possessive quantifiers when possible. Always test patterns against edge-case inputs before deploying.
Related Tools & Guides
Try Also
JWT Decoder
Decode JSON Web Tokens into header, payload, and signature. View claims, check expiration, and validate JWT structure.
Color Picker / Converter
Pick colors and convert between HEX, RGB, and HSL formats. Check WCAG contrast ratios, generate shades, and get CSS values.
Diff Checker
Compare two texts and see the differences highlighted line by line. Online diff tool with added, removed, and unchanged line detection.