Hi,

I'm trying to get a particular pattern to match, and a pattern that works in Python and other languages is not working in MySQL. I'm using 4.1.0 on RH Linux.

I archive messages from an email list, and we have a standard that posts to the list that are Off Topic should be labeled by including '[OT]' in the subject. However, some people are lazy, and type '(OT)', or '{ot}', etc. I'd like to be able to filter off-topic messages in the archives, and so a regexp that catches all these variants is what I'm looking for.

In some python scripts on the site, I use the following pattern: '[\[\(\{ ][Oo][Tt][ \]\}\)]'. That means an Open bracket/paren/brace or space, followed by 'ot' in either case, followed by a closing bracket/paren/brace or space.

        Running this in Python, I get a match:
>>> pat = '([\(][Oo][Tt][ \]\)])'
>>> tx = 'This is an (OT) Test'
>>> re.search(pat, tx).groups()
('(OT)',)

But in MySQL, I don't match:
mysql> select 'This is an (OT) Test' regexp '[\(][Oo][Tt][ \]\)]' as mtch;
+------+
| mtch |
+------+
| 0 |
+------+
1 row in set (0.00 sec)


Can anyone see the problem here?

     ___/
    /
   __/
  /
 ____/
 Ed Leafe

Linux Love:
unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to