Mark:

the key to this puzzle is the separator, the ';'

for your first question, you need to find the ';' followed by a 6. not just 
any ';', but the first ';'
the pattern would be "^[0-9]*;6"
which says
         ^         find beginning of line
          [0-9]*  followed by zero or more instances of any digit
          ;         followed by a semi colon
          6        followed by a 6

with this you should be able to figure out the answer to your second question.

At 09:55 PM 7/26/01 +0100, you wrote:
>Hi,
>
>Trying to get to grips with regexp but really want to 1st get a simple 
>expression working with mysql.
>
>SELECT Sequence, Message, id FROM $sqlTable WHERE Sequence 
>REGEXP(\"^$filterValue;\")
>
>The above works for finding matched values, where the number = to 
>$filterValue is in in the 1st part.
>
>But I need to do one for the 2nd part and 3rd and 4th etc, where each 
>value is seperated by ;
>
>So I may want to search for 6 in the 2nd part, like below:-
>
>1;6
>10;6
>100;6
>1;6;1
>10;6;10
>100;6;100
>
>I need a regexp that would get all of the above but not any value other 
>than 6 in the 2nd part.
>
>Then say I was looking for 6 in the 3rd part:-
>
>1;6;6
>10;1;6
>100;10;6
>100;100;6
>1;100;6
>10;100;6
>
>Any help would be appreciated.
>
>M.
>--
>Work:- postmasterAThinwick.demon.co.uk  WEB:- http://www.hinwick.demon.co.uk
>Work:- mworsdallATshaftesburysoc.org.uk REPLACE AT with @
>Home:- hinwickATworsdall.demon.co.uk    WEB:- http://www.wizdom.org.uk
>Shadow:- webmasterATshadow.org.uk       WEB:- http://www.shadow.org.uk
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail 
><[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>

_________________________________________________________________________________
tom marlin
tjmarlin@<nospam>surfree.com
My mind wanders a lot; sometimes it leaves completely.
                  - Duncan Hill


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to