Write regex and SQL with an AI assistant, and verify it
Regex and SQL look right and are wrong surprisingly often.
What to do
- Give sample inputs that should and should not match.
- Ask the bot to explain each part of the regex.
- For SQL, give the schema and the database engine (PostgreSQL, MySQL, SQLite).
- Run queries on a copy or with LIMIT first; never run an AI-written UPDATE/DELETE on production without a transaction and backup.
Copy this prompt
Write a [regex/SQL query] for [goal]. Engine: [x]. Schema/samples: [paste].
Then list 5 inputs that should match and 5 that shouldn't, and explain each part.Check the bot's work
Test against real samples.
Questions
Can I trust the bot on regex and sql?
Use it to plan and explain, then verify. Test against real samples.
Which bot works best?
Grok Bot, ChatGPT, Claude and Gemini all handle this prompt. Paste the same prompt into two and compare; disagreements show where to check a source.
Where these facts come from
- OWASP Top 10
- CISA: Secure by Design
- GitHub Docs: Secret scanning
- W3C: WCAG overview
- Open Source Initiative: Licenses
- NIST SP 800-218: Secure Software Development Framework
Tools, features and prices change often. We don't list prices; check each vendor's official pricing page. Never paste secrets into a prompt. Checked Oct 30, 2026.
Coding with bots · Everyday workflows: all lessons → Next: Shell scripts →