Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试过这个表达
SELECT * FROM `table` WHERE COL REGEXP "^([%\w-]+\.(?:jpe?g¦JPE?G¦gif¦GIF¦png¦PNG))$"
请帮我
@Thoman 我假设该列存储图像路径,在这种情况下,您可以只查找具有“.jpg”等扩展名的列,而不是匹配整个路径。
SELECT * FROM `table` WHERE col REGEXP '\.(jpe?g|gif|png)'
如果你有这样的colwith 值,/tmp/foo.gif那么它不会匹配\w+(word characters 表达式。)
col
/tmp/foo.gif
\w+
希望这可以帮助。