About Regex Assistant
Regular expressions are quick to write and slow to get right. The Regex Assistant puts the whole job in one window: type the pattern at the top, paste the text on the left, and every match is marked at once and listed on the right, one column per group. Click a row to jump to it in the text. The Explain panel reads the pattern part by part in plain words and draws it as a railroad diagram.
It does more than test. Replace takes $1 and $<name>, and \U or \L to change a group's case. Split cuts the text at each match. List writes every match through a template, as CSV lines, SQL or JSON. Tests keep samples that should and shouldn't match, and run them again whenever the pattern changes. The library has more than 50 tested patterns, many for Chinese use: mobile and landline numbers, ID cards, credit codes, licence plates, email, URLs, IP addresses, dates, amounts and Chinese characters. Each comes as "check a whole value" and "find in text", with samples, and ID cards, credit codes and bank cards get their check digits verified in the table.
Everything runs in your browser; nothing you type is uploaded. A pattern that backtracks without end is stopped after a time limit, with advice on how to rewrite it. Finished patterns turn into code for JavaScript, Python, Java, C#, Go, PHP and more, or into Excel 365 and Google Sheets formulas, with warnings where a language reads the pattern differently. For many files at once, "Many files" collects the matches into one table for Excel.
How to use Regex Assistant
- 1Type the pattern
Type a regular expression at the top, or pick one from the library, and switch flags such as global, ignore case and multiline.
- 2Add the text
Paste text, open a file or drop one in. Matches are marked at once and listed with their groups.
- 3Choose what to do
Switch between Match, Replace, Split, List and Tests; the result updates as you type.
- 4Copy or export
Copy the matches, export CSV or Excel, or take the code for your language from the Code panel.
Why use Cubfile for this
- Every part explained
Each piece of the pattern says what it matches, drawn as a railroad diagram too. Errors point at the exact character.
- Results as a table
One row per match, one column per group, with position and line. Copy it straight into Excel.
- 50+ tested patterns
Phone numbers, ID cards, credit codes, plates, email, dates, amounts… in two versions, with samples that double as tests.
- Replace and list
$1, $<name>, \U upper case, \L lower case; write every match as CSV, SQL, JSON or Markdown.
- Code for 16 targets
JavaScript, Python, Java, C#, Go, PHP, Ruby, Rust and more, plus Excel 365, Google Sheets and MySQL.
- Never freezes
Patterns run on their own with a time limit, and risky nested repeats are pointed out before they bite.