inyourbrowser.com

Regex split

Use a regular expression as the delimiter to split a string into parts. Each resulting segment is shown as a numbered list so you can inspect the structure.

//
Test string
0 parts
Enter a pattern and test string above

MODE

Runs entirely in your browser

How it works

The tool uses the browser's native JavaScript RegExp engine. Patterns are compiled with new RegExp(pattern, flags) and results are computed synchronously. Invalid patterns show an error badge, they never crash the page.

Processing runs in your browser

Both the pattern and the test string are processed entirely in your browser. Our servers are not involved at any point.

Related operations

For plain substring swaps without regex, try find and replace. To validate JSON patterns you are matching, use the JSON formatter. For decoding escape sequences in HTML attribute values, see HTML entities.

Frequently asked questions

How does split differ from replace?
Split breaks the string at each match of the pattern and returns the parts between matches. Replace keeps all text and substitutes the matches.
What if the pattern matches at the start or end?
If the pattern matches at the very start, the first element will be an empty string. The same applies to a match at the end.
Can I use capturing groups in split?
Yes. When the pattern contains a capturing group, the captured text is also included in the result array, interleaved between the split parts.

Related tools

Text diff
Inline or side-by-side comparison. Handles plain text and structured diffs.
Case converter
Convert text between camelCase, snake_case, kebab-case, PascalCase and more.
URL encode / decode
Percent-encode and decode URLs, or parse query strings into key-value pairs.
Find & replace
Find and replace text with plain search or regular expressions. Supports case-sensitive and whole-word matching.