this post was submitted on 08 Sep 2023
164 points (99.4% liked)
Explain Like I'm Five
14270 readers
10 users here now
Simplifying Complexity, One Answer at a Time!
Rules
- Be respectful and inclusive.
- No harassment, hate speech, or trolling.
- Engage in constructive discussions.
- Share relevant content.
- Follow guidelines and moderators' instructions.
- Use appropriate language and tone.
- Report violations.
- Foster a continuous learning environment.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Regex absolutely has many great uses. The issue is people trying to use for things they shouldn't. Then it suddenly becomes a nightmare.
Can I parse [X]HTML with regex?
You can parse any plaintext with regex, but I would recommend using XPath for that use case, instead.
https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags :)