Learn rexegg.com

The best regex trick  ↦

This post does a great job of laying out all of the cumbersome/verbose ways you can solve a problem with regular expressions and then showing the tricky way of doing the same thing without all the hassle. With this trick up your sleeve, you’ll be able to answer all of these questions:

  • How do I match a word unless it’s surrounded by quotes?
  • How do I match xyz except in contexts a, b or c?
  • How do I match every word except those on a blacklist (or other contexts)?
  • How do I ignore all content that is bolded (… and other contexts)?

Discussion

Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00