Hi I am trying to look through mysql database and pick items that stay with "t2.5" and end with "DL". I have googled for hours (honest) but can not find the symbol for "AND" although i have found for or, which is "|". What i wnat it to say is: select * from pn_quarkpage where part_number REGEXP '^T2.5 AND (DL$)'; Code (markup): Many thanks. jacka
You're not quite understanding how a regular expression works. The statement you require is.... select * from pn_quarkpage where part_number REGEXP '^T2.5.*DL$'; (except you should probably escape the "." between the 2 and 5) "." means any character in a regular expression, and ".*" means any character, repeated any number of times. So what you want is anything that starts with T2.5, then has any characters following it, then ends with DL. There is no "AND" as such in this context. Consider it in the same way you would a dir search command. If you wanted to list files that started with T2 and ended in DL you'd do.... DIR T2*DL It's very similar The only thing wrong with the expression I've given you is that it would return T2<anything>5. You need to escape the "." there but wasn't sure what the escape character is in a MYSQL regular expression. Anyone got any ideas?
Hi ecentricNick Once agian you have come to my aid. The scape character is "\", and yoru code and explanation works a treat. many thanks keep up the good work. Maybe one day I will be as good as you to help others. CHeers mate