List:General Discussion« Previous MessageNext Message »
From:Leandro Guimarães Faria Corcete DUTRA Date:November 8 2006 7:37pm
Subject:Re: Regular expression not working as expected (documented)?
View as plain text  
Em Qua, 2006-11-08 às 12:53 -0600, Dan Nelson escreveu:
> "." within brackets is treated literally anyway, so there's no need to
> use "[.period.]".

	OK, I had taken the effects of - as being the effects of .

 
> REGEXP BINARY '^wa[bhkl][-_.acegmnopqrsuvwxyz]{1,5}[14Lt][23890IJOQ].*'

	It indeeds works much better.

	I tried to improve it:

'^wa[bhkl][-_.acegmnopqrsuvwxyz]{1,5}[14Lt][23890IJOQ][-_.acegmnopqrsuvwxyz]*'

	This is to account that the last characters can’t have ascendents
(don’t ask me why), but it still doesn’t seem to be quite right:

[…]
| wabatizelli | 	-- I don’t want two ‘l’s
| wabetosp    |         -- I want one of [23890IJOQ] after that t
| walvent33   | 	-- I don’t want two ‘3’s, only one.
[…]


	I tried putting {1} after each of [14Lt] and [23890IJOQ] to no avail;
and MySQL didn’t accept *? at the end, to become non-greedy.

	Perhaps regexps are just too hard to me…

-- 
+55 (11) 5685 2219               xmpp:leandrod@stripped
+55 (11) 9406 7191          Yahoo!: ymsgr:sendIM?lgcdutra
+55 (11) 5686 9607  ICQ/AIM: aim:GoIM?screenname=61287803
        MSN: msnim:chat?contact=leandro@stripped

Thread
Regular expression not working as expected (documented)?Leandro Guimarães Faria Corcete DUTRA8 Nov
  • Re: Regular expression not working as expected (documented)?Christian Hammers8 Nov
    • Re: Regular expression not working as expected (documented)?Leandro Guimarães Faria Corcete DUTRA8 Nov
      • Re: Regular expression not working as expected (documented)?Dan Nelson8 Nov
        • Re: Regular expression not working as expected (documented)?Leandro Guimarães Faria Corcete DUTRA8 Nov
      • Re: Regular expression not working as expected (documented)?Christian Hammers8 Nov
    • RE: Regular expression not working as expected (documented)?Jerry Schwartz8 Nov