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

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

Yeah, sometimes it just makes sense to use regex, especially when looking for patterns in text. It's easier to say "look for \([0-9]{3}\) [0-9]{3}\-?[0-9]{4}" than:

  1. look for a ( character, if you find one, check that
  2. the next character matches any of 0, 1, 2, ...
  3. the next character matches any of 0, 1, 2, ...
  4. the next character matches any of 0, 1, 2, ...
  5. the next character is a ) character...
  6. ...
  7. ...
  8. ...
code of conduct - report abuse