正则表达式可能不是您想要的。mysql 支持 xpath 表达式。
这应该给你你需要的东西:
SELECT ExtractValue(resrev_meta,'//fileid') AS fileid
FROM resourcerevs
WHERE resrev_meta LIKE '%attr%';
http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html#function_extractvalue
mysql> SELECT
-> ExtractValue('<a>ccc<b>ddd</b></a>', '/a') AS val1,
-> ExtractValue('<a>ccc<b>ddd</b></a>', '/a/b') AS val2,
-> ExtractValue('<a>ccc<b>ddd</b></a>', '//b') AS val3,
-> ExtractValue('<a>ccc<b>ddd</b></a>', '/b') AS val4,
-> ExtractValue('<a>ccc<b>ddd</b><b>eee</b></a>', '//b') AS val5;
+------+------+------+------+---------+
| val1 | val2 | val3 | val4 | val5 |
+------+------+------+------+---------+
| ccc | ddd | ddd | | ddd eee |
+------+------+------+------+---------+