preg_match_all (): Compilation failed:


preg_match_all(): Compilation failed: invalid range in character class at of 升级 php 到 7.3.8 之后使用 preg_match_all() 这个函数报了这个错,检查发现是正则表达式里面用了 - 解决方法是   you can write:

[-a-z0-9_\s]
[a-z0-9_\s-]
[a-z0-9-_\s]
[a-z-0-9_\s]
[a-z0-9\s-_]
[a-z0-9_\-\s]

but not:

[a-z0-9_-\s]

参考地址 http://quabr.com/27426645/preg-match-compilation-failed-invalid-range-in-character-class

目前已知 bupt1987/html-parser https://github.com/bupt1987/html-parser 这个包中会碰到这个问题