MySQL Regexp Administative Helpers

- Dec 22, 2023 modified: Jul, 23 2025
MySQL Regexp Administative Helpers
The MySQL database provides a powerful way to perform complex text-based searches through the regular expressions function REGEXP.
Many websites are operating a MySQL database. Often we create web forms to capture contact information.
Hence some very powerful features are available to help organise that data when we combine Regexp with MySQL.
MySQL Regexp Examples
Task: Find all Customers with Phone Numbers that contain a + or - character in the Home_Ph field.
WHERE Home_Ph REGEXP '[+-]'
If we only wanted to find the numbers with a + symbol-:
WHERE Home_Ph REGEXP '[+]'
Task: If we wanted to find the emails that contain hotmail-:
WHERE Email REGEXP 'hotmail'
Task: If we wanted to find malformed emails-:
WHERE Email NOT REGEXP '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,}$'
Task: If we wanted to find the post codes that contain 4 digits-:
WHERE Post_Code REGEXP '^[[:digit:]]{4}$';
OR
WHERE Post_Code REGEXP '^[0-9]{4}$';
Source: How to Use MySQL Regular Expressions
Using the Powerful Features of your Database
MySQL is very good at handling many clients connecting and disconnecting to the database at a high frequency, up to 80 thousand connect and disconnects per second according to https://dev.mysql.com/blog-archive/mysql-connection-handling-and-scaling/.
That means your website database is incredibly evolved and efficient.
We wanted to build a system that better utilised the powerful features of our back-end systems. Why not make the website that collects the data also a powerful CRM tool?
We have the ability to monitor customer behaviour. Nothing sinister or breaches of privacy, just being able to detect which opt in customers are more interested in certain products or services.
Email Marketing from the same system, opens up even more power. Any system that requires duplication of data can be wasteful and inefficient.
Search News Articles...
Recent Articles

Do Strong CTAs Help or Hurt Your Website?
- Jul 31 2025
- /
- 139

AI Crawlers vs Search Crawlers
- Jul 04 2025
- /
- 286

AI vs. Human Writing - How to detect Ai
- Jun 26 2025
- /
- 481

Optimising for Brand SEO
- May 12 2025
- /
- 549

Google Stays Dominant in the Age of AI
- Apr 15 2025
- /
- 705

Alternatives to Booking.com for booking systems
- Apr 04 2025
- /
- 729

Public Service Cuts
- Mar 11 2025
- /
- 750

Using QR codes for your business
- Feb 24 2025
- /
- 713

What is the Network Effect?
- Feb 05 2025
- /
- 598

Connecting Communities on Twitter X
- Jan 20 2025
- /
- 659
View All News Articles
Categories
A Gold Coast SEO and Web Developer