jqiy

Regex & SQL Helper

Test regular expressions and format SQL queries in your browser.

#1 [0]: user@example.comgroups: (user, example.com)
#2 [17]: admin@test.orggroups: (admin, test.org)

About Regex & SQL Helper

The Regex & SQL Helper combines two essential developer utilities in one tool: a real-time regular expression tester and an SQL query formatter. Regular expressions are a powerful pattern-matching language used for text validation, extraction, and transformation across virtually every programming language. SQL formatting transforms raw query strings into readable, consistently indented statements that are easier to review and maintain. Both operations happen entirely in your browser.

The regex tester provides a three-panel interface: one for your regex pattern, one for your test text, and one displaying match results with highlighting. As you type, matches are highlighted in real time, and the tool explains each component of your regex pattern in plain English. This is invaluable for debugging complex patterns, learning regex syntax, or porting regex between languages with different regex flavors (PCRE, JavaScript, Python, etc.).

The regex engine supports the full ECMAScript specification including lookahead and lookbehind assertions, named capture groups, non-capturing groups, Unicode property escapes, and atomic groups. The explainer panel breaks down each token in your pattern, showing quantifiers, character classes, alternations, and group references. This educational feedback loop helps users understand why a pattern matches or fails to match a given input.

The SQL formatter accepts raw SQL queries and reformats them with consistent indentation, keyword capitalization, and line breaks. It supports MySQL, PostgreSQL, SQLite, BigQuery, and standard ANSI SQL dialects. The formatter intelligently handles complex queries with subqueries, CTEs (WITH clauses), window functions, JOINs, and UNIONs. It preserves string literals and comments while properly aligning SELECT columns, ON conditions, and WHERE clauses.

Both tools share a focus on developer workflow efficiency. The regex tester includes a library of common patterns (email, URL, phone, IP address, etc.) that you can load and customize. The SQL formatter can minify queries for production or expand them for code review. Results can be exported or copied with a single click. The combined tool saves developers from switching between multiple websites for these related but distinct tasks.

For teams, the ability to share regex patterns or formatted SQL via URL is a collaboration feature. When debugging a tricky regex or reviewing a complex SQL query, you can send a shareable link that preserves your exact input, pattern, and settings. This eliminates the back-and-forth of trying to reproduce someone else's testing environment and makes code review sessions more productive.

Frequently Asked Questions

What regex syntax does this tool support?

It uses the ECMAScript regex engine and supports the full ES2023 specification including lookahead/lookbehind, named groups, Unicode property escapes, and indented flag for free-spacing mode.

Can I use regex flags like case-insensitive or multiline?

Yes. Flags are toggleable buttons above the pattern input: g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode), and y (sticky). The tool reflects the flag's effect instantly in match results.

What SQL dialects are supported?

The formatter supports MySQL, PostgreSQL, SQLite, Google BigQuery, SQL Server, Oracle, and standard ANSI SQL. Select your dialect from the dropdown to get dialect-appropriate formatting.

Does the SQL formatter handle stored procedures and triggers?

Yes. It can format stored procedures, triggers, functions, views, and other SQL DDL statements in addition to DML queries like SELECT, INSERT, UPDATE, and DELETE.