4 ms·
Does it support HTML? Can one parse HTML with regex?
by kozhevnikov 7y ago
Does it support HTML? Can one parse HTML with regex?
- singlow 7y agoYou can't parse it properly with a Regular Expression, but you can parse it with regex-like systems. However I doubt it is parsing outright - it only has to look for certain keywords and patterns that indicate certain behaviors.
- guydalf 7y agoCorrect. We don't need to parse it per se just look for use of features that are easy to identify like XmlHttpRequest, Json.Parse use etc.
- SloopJon 7y agoIt doesn't appear to be parsing at all. It's just looking for patterns. If you look at languages.json in RulesEngine/Resources, files with the extension .html (and some others) are recognized as "html", with type "code": { "name": "html", "extensions": [ ".html", ".htm", ".cshtml", ".tmpl" ], "type": "code" }, This sets the scope for the patterns in AppInspector/rules/default; e.g., { "name": "Content Management Framework: Wordpress", "id": "AI021200", "description": "Development Framework: Wordpress", "applies_to": [ "javascript", "html" ], "tags": [ "Framework.CMS.Wordpress" ], "severity": "moderate", "patterns": [ { "pattern": "wordpress", "type": "string", "scopes": [ "code", "comment" ], "modifiers": [ "i" ], "confidence": "high" } ] }, This seems like it would be prone to a lot of false positives, but I haven't tried the tool.
- JadeNB 7y agoBoy, are you in for a fun StackExchange read: https://stackoverflow.com/a/1732454 https://stackoverflow.com/a/1732454 .