You guys truly rock my socks! Awesomesauce!
I have run into a problem though... I am trying to find all of the following instances and then count them (yes, with the square brackets included): [a], [e], [p], [l], [d], [w], and [f]. The regexp that I am using is \[[aefdwpl]\] to create this query (obviously this query is just to test on one row):
SELECT w_attack, SUM(
CASE WHEN w_attack REGEXP '\\[[aefdwpl]\\]'
ELSE 0 END
) AS attack_icons
FROM weapons WHERE w_id = 1 GROUP BY w_id
But unfortuately it is returning only 1 for attack_icons (when in fact, there are 23 matches). Does the MySQL REGEXP function match everything? Or just find one match and then stop? Let me know... how should I go about fixing this problem?
Thanks in advanced! Again, you guys rock! I should nominate r937 for SQL guru...