Reputation: 588
sorry for my English.
Please help with pregex in MySql. I want to find two words in text. Between this words can be one or more spaces and/or punctuation mark.
For example:
Tree, apple
Tree , apple
Tree ,apple
Tree ,apple
Tree,apple
Thanks you!
Upvotes: 1
Views: 66
Reputation: 86
MySQL natively supports RegEx since 5.1. Are you looking for something like:
SELECT * FROM `mytable` WHERE `mycol` REGEXP '[[:alpha:]]+[ ,.]*[[:alpha:]]+'
For more information, check out the MySQL Documentation
Upvotes: 2