home page latest news web development curriculum vitae scripts contact me

  • C# (Microsoft .NET)
  • JAVA
  • Dynamic HTML
  • PHP & MySQL
  • ASP.NET - C# & VB.NET
  • Perl & CGI
  • C | C++
  • Vector Markup Language
  • SMIL
  • Assembler
  • Databases
  • Wap Development
  • Web site promotion
  • Web Marketing

NETART MEDIA is one of the fast growing European IT companies striving to offer high quality web and e-commerce products, like for example:

Blog System v1.5

Real Estate Portal v3.0

Jobs Portal v1.3

Car Portal v2.0

PHP Mall v2.0


WebSiteAdmin.biz



How to use regular expressions in MySQL database queries?

(Free programming example written by Anton Zamov.
Find more free examples on "The ultimate source for developers" )



One of the things I like the most in MySQL is
the possibility to use regular expressions in the SQL
queries.
 

A very simple example illustrating this is to select
all the records from MyTable for which MyField starts with "A"
 
SELECT * FROM  MyTable WHERE MyField REGEXP '^a';
 
Please take a look to the list below in order to find more information
for the available options
 

MySQL Regular Expressions
 


Matches zero or more instances of the string preceding it
 

Matches one or more instances of the string preceding it
 

Matches zero or one instances of the string preceding it
 

Matches any single character
 
[xyz] 
Matches any of x, y, or z (the characters within the brackets)
 
[A-Z] 
Matches any uppercase letter
 
[a-z] 
 Matches any lowercase letter
 
[0-9] 
Matches any digit
 

Anchors the match from the beginning
 

Anchors the match to the end
 

Separates strings in the regular expression
 
{n,m} 
String must occur at least n times, but no more than n 
 
{n} 
String must occur exactly n times
 
{n,| 
String must occur at least n times



If this example was useful for you, please support my company and click Like on the button below. Thank you very much!


Links:

PHP Mall, software for running multi users mall websites

Real Estate Portal, script for powerful real estate portals

JobSite Professional, advanced jobs board software

Blog System, multi user blog hosting script

Car Portal, software for auto classifieds websites

Vlog System, video blog hosting script

WebSiteAdmin, flexible content management system

Pharmacy System, software for running online pharmacies

WebSite Creator, multi users content management system, fast website creation

Jobs Portal, flexible jobs portal solution

BlogSite Professional, community multi user script, start blogging and make firends

VlogSite Professional, video blogs community hosting script

NetArt Mall, create your online store for free and start selling online

Blog23, free blog portal - create your blow within minutes

RealEstate23, free USA real estate portal

BuyGreatDomain, buy or sell a domain name for free

iSellWebsite, free websites marketplace, post your website for sale

C# (Microsoft .NET) | JAVA | Dynamic HTML | PHP & MySQL | Perl & CGI | C | C++ | Vector Markup Language
SMIL | Assembler | Databases | Wap Development | Web site promotion | Web Marketing

Copyright © Anton Zamov 1998-2010