> input is >SELECT dog_name FROM hold_tbl WHERE dog_name RLIKE "^sam[0123456789]*" 
> ORDER BY dog_name<
> 
> (and then printing out each of the matches made)
> Sam 
> Sam4 
> Sam5 
> Sammie6 
> Sammy7 
> Sampson2 
> Samson 
> Samuel 
> 
> As I understand it, only the first three should have matched.
> Actually, as I really understand it none of them should have matched
> because REGEXP/RLIKE are case sensitive searches.  It makes no difference
> if I use REGEXP instead of RLIKE.
> 
> Also, I couldn't find any indication that mysql's regexp understood
> [0-9] as opposed to [0123456789], am I correct?  Again, it makes no
> difference if I try that notation.
> 
> Thanks,
> 

The query you want is dog_name RLIKE "^sam[0123456789]*$"

Each of the above matches sam at the beginning folowed by ZERO or more numbers.
If you put a "$" at the end. It anchors to the end of the string like "^" 
anchors to the beginning.




> 
> --Cindy
> 
> ---------------------------------------------------------------------
> 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
> 



---------------------------------------------------------------------
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


---------------------------------------------------------------------
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