MySQL Forums
Forum List  »  Newbie

Re: REGEXP problems
Posted by: Felix Geerinckx
Date: May 19, 2005 02:54PM

Emily Frazier wrote:
> I'm searching through a table called "Subjects" for the string "Social Sciences". However, I also
> hav ea subject in this table called "Science". So when I do the regexp it does both...but I want it
> to strictly only accept exact matches.

From the example "Social SciencesHistoryArt" in your original post I suppose you cannot use the word boundary markers [[:<:]], [[:>:]] (see http://dev.mysql.com/doc/mysql/en/regexp.html).

So I would suggest you add another column 'seen' to your table and set it when you encounter a match, so you can ignore the record with the next regex. Then start matching from long to short (i.e. first Social Sciences, then Science).

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
May 19, 2005 11:51AM
May 19, 2005 12:25PM
May 19, 2005 01:46PM
Re: REGEXP problems
May 19, 2005 02:54PM
May 19, 2005 04:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.