2.6K Followers
·
Follow

Image for post
Image for post

Someone once made a great point about using Regex to parse XML and HTML. In short: don’t do it, you’ll release Zalgo, and suffer a horrible fate. XML and Regexes just don’t gel well together. Or… do they?

I was thinking about this and mulling over just how inconvenient regexes are.

  • You have to write this huge string of almost incomprehensible text
  • It’s very easy to make mistakes that only surface at runtime
  • It’s very easy to forget to escape special characters like . or $
  • It’s even harder to build regexes programmatically, if you have a lot of dynamic values you want to check…

About

Daniel Brain

works for PayPal, as a lead engineer in Checkout. Opinions expressed herein belong to him and not his employer. daniel@bluesuncorp.co.uk

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store