Reg Exp issue

From: Date: Fri, 20 Sep 2002 22:17:23 +0000
Subject: Reg Exp issue
Groups: php.general 
Request: Send a blank email to php-general+get-117061@lists.php.net to get a copy of this message
Hello, I am trying to find a string in another string with mysql. Normally, this would work. select 'foo' REGEXP ('foo'); And that would simply return 1, since it found it. But, my strings are more complicated than that. One good random example is something like this..Ya i know, its wierd but go with me on this. ok/2.0 (hah 3.0; BAM oh 5.1; .hi CLR 1.0.4725) so you would do a select like.. select 'ok/2.0 (hah 3.0; BAM oh 5.1; .hi CLR 1.0.4725)' REGEXP ('ok/2.0 (hah 3.0; BAM oh 5.1; .hi CLR 1.0.4725)'); That of course doesnt work. All of the () 's, and /'s, and .'s, mess it all up. And suggestion on what to do? any function to convert all of the special regexp characters ()[];.^*$ etc to work correctly? Thank You, Taylor York

« previous php.general (#117061) next »