News for hackers. Stuff that matters.
Re:Ruby's Email Address Regexp by zamadatix on Tuesday January 04, 2022 @11:00PM (#29804964)
The index of the first character is 0 and an email must have a local part so that means the index of "@" has to be at least 1. My guess is OP also forgot the index of the first character is 0 instead of 1 resulting in 1+1=2 (that or they meant >=).

Off by one errors are about half of working with arrays.

Re:Ruby's Email Address Regexp by zarzavat on Wednesday January 05, 2022 @02:35AM (#29806209)
This is actually an uncommon example of an off-by-two error as they used strictly greater than 2.

  a@domain   fail
  ab@domain  fail
  abc@domain ok