Skip to tool

SQL Regex replace Online

Replace regex matches in input.

The output updates as you type. The tool processes input in your browser.

Worked example

The browser applies the pattern globally. Use JavaScript replacement syntax such as $1 for the first captured group. Use PostgreSQL’s function reference to adapt the input to SQL syntax.

Regex pattern
"/\\d+/"
Replacement
"#"
Flags
"g"
Sample input
abc123def456
Sample output
abc#def#

Using this operation in SQL

The interactive result uses JavaScript. Check the database dialect. PostgreSQL text functions use SQL-style one-based positions and LIKE uses its own pattern syntax.

SQL reference