Regex Tester
Test regular expressions with live highlighting, capture groups, and replace mode. Everything runs in your browser — no data is sent anywhere.
Bubble.io Compatibility
Bubble :extract with Regex
This is what Bubble returns — a list of full matches (no capture groups).
Match Details
Enter a pattern and test string to see match details.
Quick Reference
Character Classes
.- Any character (except newline)
\d- Digit [0-9]
\w- Word char [a-zA-Z0-9_]
\s- Whitespace
\D \W \S- Negated versions
[abc]- Character set
[^abc]- Negated set
[a-z]- Range
Quantifiers
*- 0 or more
+- 1 or more
?- 0 or 1
{3}- Exactly 3
{3,}- 3 or more
{3,5}- Between 3 and 5
*?- Lazy (non-greedy)
Anchors & Groups
^- Start of string/line
$- End of string/line
\b- Word boundary
(abc)- Capture group
(?:abc)- Non-capturing group
(?<name>abc)- Named group
a|b- Alternation (or)
(?=abc)- Positive lookahead
Flags
g- Global (all matches)
i- Case insensitive
m- Multiline
s- Dotall (. matches \n)
u- Unicode
Regex in Bubble.io — What You Need to Know
Bubble uses JavaScript's RegExp engine with the global flag (g) always enabled. You cannot change flags or use inline modifiers like (?i). This tester's Bubble Mode replicates that exact behavior.
Bubble's Three Regex Operations
- :extract with Regex — Returns a list of full matches. Capture groups are not exposed. Use this tool's "Bubble :extract" panel to see exactly what you'll get.
- :find & replace — Supports
$1,$2backreferences in the replacement string. Enable replace mode above to test this. - matches regex — Returns true/false. If the pattern matches anywhere in the text, it's true.
Common Workarounds
- Case-insensitive matching — Apply
:lowercaseto the text before running your regex, then write the pattern in lowercase. - Extracting capture groups — Use lookbehind:
(?<=prefix)(.*)to exclude a prefix from the match, since Bubble only returns full matches. - Multiline text —
^and$only match start/end of the entire string. Use\nexplicitly to match line boundaries.
Patterns That Work in Bubble
- Email —
[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,} - Phone (international) —
\+?[1-9]\d{1,14} - Extract @mentions —
@\S+ - Extract #hashtags —
#\w+ - Numbers only —
\d+ - URL —
https?://[^\s]+ - Hex color —
#([a-fA-F0-9]{6}|[a-fA-F0-9]{3}) - Strong password —
^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
How to Use Regular Expressions
Regular expressions (regex) are patterns used to match character combinations in strings. They're essential for text processing, input validation, data extraction, and search-and-replace operations across every programming language.
Common Patterns
- Email —
[\w.-]+@[\w.-]+\.\w{2,} - URL —
https?://[\w.-]+(?:/[\w./?%&=-]*)? - Phone (US) —
\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4} - IP Address —
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} - Date (YYYY-MM-DD) —
\d{4}-\d{2}-\d{2} - HTML Tag —
<([a-z]+)[^>]*>.*?</\1>
Replace Mode
Enable replace mode to test search-and-replace. Use $1, $2, etc. to reference capture groups. Named groups use $<name>. The dollar sign $& inserts the entire match.