NYCPHP Meetup

NYPHP.org

[nycphp-talk] Regular Expression Assistance in MySQL

Peter Sawczynec ps at pswebcode.com
Wed Jul 20 10:16:18 EDT 2005


I need this reg exp example you provided to also accept "OR a colon" on the
left side only.

Peter

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of David Mintz
Sent: Monday, July 18, 2005 10:34 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Regular Expression Assistance in MySQL


On Mon, 18 Jul 2005, Peter Sawczynec wrote:

> The West and a Western South-westerly Revolt
>
> What is the reg exp that would match only the freestanding West and 
> not match the West in Western or South-westerly.

This seems to work:

mysql> SELECT 'The West and a Western South-westerly Revolt' REGEXP 
mysql> BINARY
'[[:<:]]West[[:>:]]' as matches;

+---------+
| matches |
+---------+
|       1 |
+---------+
1 row in set (0.01 sec)

(http://dev.mysql.com/doc/mysql/en/regexp.html)

---
David Mintz
http://davidmintz.org/ _______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org





More information about the talk mailing list