php-simple-html-dom-parser icon indicating copy to clipboard operation
php-simple-html-dom-parser copied to clipboard

php-simple-html-dom-parser for PHP7.3 +

Open WebSergeevDima opened this issue 6 years ago • 1 comments

If you use php 7.3 and higher, then use my edits. Otherwise, you will get errors due to migration to PCRE2 in new versions of PHP.

For example: Warning: preg_match_all (): Compilation failed: invalid range in character class at offset 4

New file

WebSergeevDima avatar Oct 25 '19 15:10 WebSergeevDima

Yep, it's the new strict PCRE2 caused by regex

\w-:

which should be

\w\-:

Here is the simple snippet used in php.net

preg_match('/[\w-.]+/', ''); // this will not work in PHP7.3
preg_match('/[\w\-.]+/', ''); // the hyphen need to be escaped

ldim87 avatar Nov 22 '19 11:11 ldim87