re: What I Learned From Bombing An Amazon Coding Assessment VIEW POST

re: I've always wondered why they are called "regular expressions".. when in fact, their more like "special-ability-superhuman expressions". hahaha. Jo...

I think you can always help with understanding of regex by commenting and naming, just like you would with other code items.

  # number or plus as first character, number or certain characters as other characters
  BASIC_PHONE_REGEX = "^[0-9\+(][0-9)(\-\.ext\s]+"

Yep, very good. Perhaps even add the expected result as part of the comment.

When tdd is viable, rex can be expressed very thoroughly in tests. They need to be tested differently anyway because of their versatility, so those tests go a long way to show what it should/not do is a godsend when it comes to understanding someone else's line noise.

code of conduct - report abuse