Clean

Apply regular expression replacements across CSV columns

Apply regex patterns with capture groups to transform cell values across CSV columns.

🛡️ Your rows never leave your browser.
Why Onfyt: Preview mode shows the first 5 transformed values before applying—so you confirm the regex works correctly before modifying all rows.

Interactive Sample Data

nameemailphone
Grace Kerubograce@corp.com254712345678
Peter Njorogepeter@startup.io254722112233

How this tool works

Regex replacements go beyond simple find-and-replace when values follow a pattern but vary: extracting the domain portion of email addresses, stripping non-digit characters from phone numbers, or reformatting dates from YYYYMMDD to YYYY-MM-DD. Regex patterns with capture groups make these transformations precise and reproducible. DataFix uses JavaScript's RegExp API with backreferences ($1, $2 etc.) in replacement strings. Patterns are applied per-cell to the specified column or all columns. Regular expression pattern replacement enables complex string manipulations, such as reformatting dates, stripping internal tracking codes, or masking sensitive account numbers with surgical precision. Regex pattern matching provides surgical precision when standard string replacement is insufficient. Whether reformatting date strings from DD.MM.YYYY to ISO-8601, masking credit card digits, or stripping internal tracking identifiers, our regex engine runs locally with full JavaScript RegExp syntax support and instant preview highlighting. Regex evaluation runs in a sandboxed Web Worker environment with comprehensive timeout safeguards to protect against catastrophic backtracking. Capture groups and backreferences ($1, $2) can be used directly in replacement strings to reformat composite codes effortlessly. Regex error highlighting flags invalid syntax in real time with actionable syntax error diagnostics, preventing malformed expressions from executing across rows. Real-time preview indicators show transformed cell samples directly, verifying that capture substitutions perform as expected across rows. Global match flags ensure that recurring pattern instances across text strings are replaced completely.

Things that usually go wrong

  • Greedy quantifiers (.*) can match too much. Use non-greedy (.*?) or anchored patterns (^, $).
  • The replacement string $1 refers to the first capture group — ensure the pattern has a group: (\d+).

Edge cases we tested

🧪 Regex with global flag on cells containing repeated matches

All occurrences replaced in one cell when 'g' flag set.

🧪 Capture group referencing a non-existent group number

Replacement leaves $N literal; error shown in preview mode.

Frequently Asked Questions

Can I use lookahead/lookbehind?

Yes — JavaScript regex features including lookahead (?=...) and lookbehind (?<=...) are supported.

Are all occurrences in a cell replaced?

Yes — the 'g' (global) flag is always applied.

Related tools

Clean

Split Full Name into First and Last

Separate full name columns into dedicated first_name and last_name columns in CSV and Excel spreadsheets.

Open Tool →
Clean

Combine First and Last Name

Merge separate first and last name columns into a single clean full_name column, trimming extra spaces.

Open Tool →
Clean

Remove Duplicate Rows

Eliminate duplicate rows across your entire dataset or based on specific unique key columns.

Open Tool →