philnash

@philnash@programming.dev

This profile is from a federated server and may be incomplete. Browse more on the original instance.

philnash,

Ah, I didn’t realise there was a regex channel here. Thanks!

philnash,

While this article is about JavaScript specifically, these issues certainly exist in other regex engines too.

philnash,

JavaScript’s regex engine isn’t the only one to have these problems. There certainly are other implementations, like Re2 and Rust’s implementation, that don’t have this issue. But they also lack some of the features of the JS implementation too.

philnash,

That’s brilliant!

philnash,

Thanks!

philnash,

The only real way to validate an email address is send it an email and see if it arrives! I’m sure many of us have fallen to the urge to validate an email with a regex though, and yes, it’s just too dangerous! I definitely like the simplicity of checking for an @.

I think regular expressions are actually very tempting to use because they seem hard. I feel like I go through this XKCD comic every time the opportunity to use a regex comes up. But string functions often have the answer. I hope, if this article achieves anything, it just stops people using regex to trim whitespace!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • osvaldo12
  • ngwrru68w68
  • GTA5RPClips
  • provamag3
  • InstantRegret
  • everett
  • Durango
  • cisconetworking
  • khanakhh
  • ethstaker
  • tester
  • anitta
  • Leos
  • normalnudes
  • modclub
  • megavids
  • lostlight
  • All magazines