What is a Regular Expression (Regex)?
A Regular Expression (commonly abbreviated as Regex or Regexp) is a sequence of characters that forms a search pattern. This pattern is utilized by search engines, text editors, and programming languages to match, validate, replace, or extract specific substrings within a body of text. Regex is highly powerful, allowing you to validate email formats, locate phone numbers, parse HTML logs, or extract server keys with single-line statements.
RTSALL Regex Cheat Sheet & Syntax Quick Guide
To help you get started testing regular expressions, here is a quick reference table of standard operators:
| Character | Description | Example Match |
|---|---|---|
| . | Matches any single character except newline. | c.t matches cat, cot |
| \d | Matches any digit (0-9). Equivalent to [0-9]. | \d{3} matches 123, 987 |
| \w | Matches any word character (letters, numbers, underscore). | \w+ matches rtsall, compile_code |
| * | Matches 0 or more occurrences of the preceding element. | ab* matches a, ab, abbb |
| + | Matches 1 or more occurrences of the preceding element. | ab+ matches ab, abbb (no match on a) |
| ^ | Asserts the start of the line or string. | ^Hello matches starting line word Hello |
| $ | Asserts the end of the line or string. | end$ matches final line word end |
Understanding Regex Flags
Regex matches can be modified using flags. The most common flags are:
- g (Global): Continues matching all occurrences in the text rather than stopping after the first match.
- i (Case-insensitive): Ignores capitalizations (e.g.
[a-z]matchesA,B,c). - m (Multiline): Makes the start and end boundary assertions (
^and$) apply to the beginning and end of individual lines, rather than the entire search string.
Privacy & Offline Utility
Your test logs and string patterns are processed 100% inside your web browser sandbox. RTSALL does not compile or forward your strings to any server. This guarantees that internal log entries, personal customer records, and email lists remain private and secured on your local system.
Frequently Asked Questions (FAQ)
Q: What regular expression flavor does this tester use?
A: This tool runs using the JavaScript (ECMAScript) Regex engine. This matches the regex implementations found in modern programming environments like Node.js, Python, and Java (with slight modifications).
Q: How do I escape special characters like periods or question marks?
A: To match a literal special character (e.g., matching a dot . rather than matching any character), escape it with a backslash: \. or \?.
![]()