I use some Regexp in my mySQL search queries and it seems to work fine unless I have a # character in the query.
The Regexp matches based on word boundaries because the field in which this query is searching is entire resumes / curriculum-vitaes stored in the SQL database.
For instance this works as expected and returns the correct number of results:
SELECT COUNT(*) n FROM candidate c WHERE (c.CV REGEXP '[[:<:]]java[[:>:]]');
However, this doesn't and returns 0 results when it should return a few hundred:
SELECT COUNT(*) n FROM candidate c WHERE (c.CV REGEXP '[[:<:]]c#[[:>:]]');
I understand now that this is because I am matching based on word boundaries and # cannot be the end of the word. Interestingly, "C++" works fine though.
Is there a way of modifying this REGEXP so it also works with a string like "c#"?