Attribute Parser

  • + 2 comments

    Here are the 3 regular expressions I used, they might not be perfect but they passed all test cases. Let me know if you'd prefer to see the complete algorithm:

    regex is_opening_tag_regex("<([a-zA-Z0-9_]+).*>");
    regex is_enclosing_tag_regex("</([a-zA-Z0-9_]+).*>");
    regex match_attr_regex("([a-zA-Z0-9_]+) = \"([^\"]+)\"");