Gordon, Check http://dev.mysql.com/doc/mysql/en/regexp.html for regular expressions and mysql. I'm sure you'll find what you need there. (although, I'm not sure what version you're using and also not sure since what version this is possible in mysql).
Regards, Piet. > -----Original Message----- > From: Gordon Stewart [mailto:[EMAIL PROTECTED] > Sent: woensdag 4 mei 2005 12:21 > To: [email protected] > Subject: [php-list] mysql preg ? > > > PS - Anyone know a good site - "Beginners Guide to MYSQL > Queries" (with plenty of examples...) > > > Me again.... > > Ive got (& sucesfully using) :- > > $query = "SELECT * FROM table where Fleet LIKE '%$SEARCHTEXT%'"; > > - this allows me to search where a given field has a > particular word / phrase $SEARCHTEXT > > QUESTION... > > Ive got one field, where there is a letter/number > combination, OR a letter/number-combination with a dash & 6-digits... > > IE :- > > YR567 > PS234-20040908 > UDE428 > KII871-20050412 > JD67 > > is there a query string I can use to find all records with > the -DDDDDD / dash and six digits (I do not know the digits - > I want ANY 6 Digits...) (not 5 digts, or 7 digits) > > - Something like preg_match or something ? > > Also - The reverse - Find all rows with *NO* dash and 6-digits... > > Is this possible in a MYSQL comamnd - Ps, If not, I could > just get the whole lot - & loop through it with preg_match.. > > Thanks... > > PS - Anyone know a good site - "Beginners Guide to MYSQL > Queries" (with plenty of examples...) > > Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
