Skip to content

Conversation

@adriannh48
Copy link

I was having trouble loading the string with the HTML code by the function:
HtmlDomParser::str_get_html($file_name);

}

if (!preg_match("/^[\w-:]+$/", $tag)) {
if (!preg_match("/^[\w:]+$/", $tag)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not supposed to be removed but escaped by slash (-)

// farther study is required to determine of this should be documented or removed.
// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
$pattern = "/([\w:\*]*)(?:\#([\w]+)|\.([\w]+))?(?:\[@?(!?[\w:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not supposed to be removed but escaped by slash (-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants