Does anybody know how I could have, in a MySQL query, the same behaviour as the Regex.Replace function (for instance in .NET/C#)?
I need that because, as many people, I would like to count the number of words in a field. However, I'm not satisfied with the following answer (given several times on that site):
SELECT LENGTH(name) - LENGTH(REPLACE(name, ' ', '') +1 FROM table
Because it doesn't give good results when there are more that one space between two words.
By the way, I think the Regex.Replace function may be interesting so all the good ideas are welcome !