Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions s/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ are inadequate for the job. You should use an HTML parser.

This site shows you how.

# Why **regexes** are bad for **HTML parsing**

* [This answer on stackoverflow](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454) is a good starting point.
* [This post by Tom Christiansen](http://stackoverflow.com/questions/4231382/regular-expression-pattern-not-matching-anywhere-in-string/4234491#4234491) shows that **you can parse HTML with regex**. The solution is neither easy to comprehend/debug/extend nor practical when you have dedicated libraries to do the **HTML parsing** as alternatives.



# To do

* Add more languages.
* Explain why regexes are bad.
* Explain how fragile regexes are.
* More explanations of why regexes are bad.
* More explanations of how fragile regexes are.

# Thanks

Expand Down