DEV Community

Discussion on: What I Learned From Bombing An Amazon Coding Assessment

Collapse
 
databasesponge profile image
MetaDave 🇪🇺

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]+"
Thread Thread
 
morgboer profile image
Riaan Pietersen

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

Thread Thread
 
therealkevinard profile image
Kevin Ard

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

Thread Thread
 
richardhendricks profile image
Richard Hendricks

regex101.com/ is a godsend when it comes to understanding someone else's line noise.