php-simple-html-dom-parser
php-simple-html-dom-parser copied to clipboard
PHP 7.4
Does the library work with PHP 7.4 ? Cause i get some error, in the past i already used the Php Simple Html Parser and everything was all right.
Hi there.
Getting exception preg_match(): Compilation failed: invalid range in character class at offset 4
on php 7.4.
Anyone else got that?
Same here, it doesn't work! Found out that this project is abandoned. Use this fork instead.
Thank you
Just a \ needs to be added before all the hyphens in the regex defined in file simple_html_dom.php ( 2 lines to be specific )
The fix has yet to be implemented into the repo. Had to manually edit the source scrip to get rid of the error. Don't think this fix will get added in as the repo hasn't been updated in years....
Had to add a \
infront of all the -
hyphens on here:
$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
if (!preg_match("/^[\w-:]+$/", $tag))
Thanh you