I have a string matching question that is beyond my knowledge when it comes to regex in mysql.
The Situation:
I have a rather large table with csv fields that needs to be searched and I need to be able to match rows according to 1+ user specified search terms. For example the user needs to be able to search for clock and radio. The issue is that I only want it to match separate comma separated values. So searching for clock and radio would only match were the field contains "clock, whatever, radio" and not "clock radio"
My thinking:
I need a regular expression that will match;
- the beginning of the string, a comma, or a space
- search term 1
- zero or more spaces
- then either a comma or the end of the string
then an OR and the same thing for search term 2.
Thank you in advance
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.