Skip to content
TabKiwiTabKiwi

Regex Splitter

Split text into pieces wherever a regular expression matches, with trimming and empty-piece removal.

DeveloperRuns in your browser. Your files never leave this device.
Loading tool…

About this tool

Simple splitting on one comma breaks down when the data mixes commas, semicolons and pipes or has uneven spacing. Here the separator is a regular expression, so a single pattern like \s*[,;|]\s* handles all of them, and you can trim pieces, drop empty ones or keep the separators. The result comes out one item per line or as a JSON array, and the text never leaves your device.

How to use Regex Splitter

  1. Enter the separator as a regular expression.
  2. Paste the text to split.
  3. Choose trimming, empty-piece and separator options.
  4. Copy the pieces as lines or as a JSON array.

Frequently asked questions

How do I split on any whitespace?

Use \s+ as the pattern. It treats spaces, tabs and line breaks, in any amount, as one separator.

How do I split before a character without removing it?

Use a lookahead such as (?=[A-Z]). It matches an empty position, so nothing is removed.

More Developer tools

View all 91 →