views:

466

answers:

2

I am having a trouble matching a string in a MySQL-query with the following regex:

I want it to match to this string: "Rue de l' Harmonie"

SELECT id, street_name FROM street_names WHERE street_name REGEXP '^(rue[a-z]+[[:blank:]])((du|de|la|des|d[\']|l[\'])[[:blank:]])*[[:<:]]HARMONIE$'

Anybody can give me a hint?

+2  A: 

At the beginning:

^(rue[a-z]+

The + requires that there be at least one a-z char directly following rue. You probably want *.

Adam Bellaire
A: 

Thanks Adam!

dEEf