Text sorter
Sort lines alphabetically or in natural number order, with optional reverse sorting. Compare item2 and item10 locally without uploading your list.
Text & writingTest JavaScript regular expressions, inspect captures, replace text and extract matches. A bounded worker keeps difficult patterns off the page.
Presets change settings only. Your input stays in place; Undo restores previous settings.
Ready when you are.
Indices are zero-based JavaScript string positions. This example finds an email-like string; it is not comprehensive email validation.
Text: [email protected] Pattern: [\w.+-]+@[\w.-]+\.[a-zA-Z]{2,} Flags: gi
1 match: [email protected], starting at index 0
Enter the pattern without enclosing /slashes/, set flags separately and paste sample text. Select Test pattern. Review highlighted matches and the JSON result; Copy or Download keeps the JSON, not the highlighting.
Uses your browser’s JavaScript RegExp engine, not PCRE or Python. Runs stop after one second and return at most 1,000 matches. A completed test is not a performance or validation guarantee for production.
Some patterns have excessive backtracking. The test runs in a worker and stops after one second. Try fewer nested quantifiers or shorter input; results are capped at 1,000 matches.
No. This tool processes your input in your browser. We don't store your text, files or results. Standard website access logs are separate; read our privacy notes.
Yes. No account, subscription or usage credits are required.
Use Copy or Download after running the tool. Inputs are not saved automatically and disappear when you leave or refresh the page.
Use pattern \bcat\b with text Cat cat scatter. Flags gi return Cat at index 0 and cat at index 4; i alone returns only Cat. g searches repeatedly, i ignores case, m makes ^ and $ match line boundaries, and s lets a dot match a newline. Enter flags without slash delimiters. Duplicate flags and unsupported combinations such as uv are rejected; newer features depend on your browser.
For text order=42; order=107, use order=(?<id>\d+) with flag g. The two full matches start at indices 0 and 10. Their groups arrays contain 42 and 107, and namedGroups maps id to each captured string. An unmatched optional capture becomes null in the JSON groups array; unmatched named captures are omitted from namedGroups.
To find a whole status line, use ^OK$ with flags gm and text OK, FAIL and OK on separate lines: two matches at indices 0 and 8 when line breaks are single LF characters. For text 😀a, pattern a returns index 2, not 1: offsets count UTF-16 code units. With pattern . and flag gu, the emoji is one match; without u it can be split into surrogate halves. The d flag does not add capture-offset arrays to this tool’s exported JSON.
A zero-width match is displayed as ∅ and advances before the next global search, so an empty pattern can match between characters. Results stop at 1,000; limited=true means more than 1,000 matches were found. If a pattern times out, reduce the input or remove overlapping/nested quantifiers and rerun. The built-in email-like example is an extraction demo, not comprehensive email-address validation.
Choose Replace matches to use JavaScript replacement tokens: $1 for capture 1, $<name> for a named capture, $& for the whole match and $$ for a dollar sign. Extract matches returns full matches separated by line breaks and downloads as TXT. Both honor flags: use g for all matches. Extraction refuses more than 1,000 matches rather than silently exporting a partial list. Replacement output is limited to 4 million characters; all operations retain the one-second worker timeout.
Open Test cases and write one case per line: + followed by a space for text that should match, or - followed by a space for text that should not. Matching anywhere counts. Each case starts with a fresh regex; up to 30 cases and 10,000 characters are supported. Export capture groups produces a JSON array with each full match, index, numbered groups and named groups. Like full-match extraction, it refuses to export more than 1,000 matches.
After extracting a list, remove duplicate lines or sort it. Match mode exports JSON; Extract mode exports the matched values as text, ready for list tools. Use JSON formatter to inspect the full export.
Method reference: MDN JavaScript regular expressions and flags.
Choose the right developer tools workflow before combining tools.
Something not right? Report a problem with this tool. Include the steps, but never passwords or private input.
Sort lines alphabetically or in natural number order, with optional reverse sorting. Compare item2 and item10 locally without uploading your list.
Text & writingRemove repeated lines while keeping the first occurrence and original order. Optionally ignore letter case; spaces remain significant. Runs in your browser.
Text & writingFormat JSON without rounding large numbers. Edit values, copy paths, compare documents and inspect a searchable tree locally in your browser.
Developer tools