DEV Community

Discussion on: Regex - What I Learned Trying to Parse HTML

Collapse
 
bias profile image
Tobias Nickel

interesting thought, I also have an xml/html parser on npm and i directly had to test if it works right with your script tag example. It works, because I handled the script tag extra. The script tag could even contain comments with xml inside. I will add your example to its test cases.

When I needed an xml parser (in browser and worker) I was also checking regex, but they can not express that open and close-tag need to have the same name.

after some test with ebnf i just parsed xml strings just with js,...