treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] What am i forgetting? [a-z A-Z] REGEX & Brain Farts

  • Howdy folks, im testing to make sure there is only letters passed, no numbers or special chars. How do i only accept letters?

    This seems like such an elementary question but its late, im half asleep, and everything on the screen is starting to look the same. I would really love some quick help from this massive brain fart im having.

    Would this be good enough:
    ^[a-zA-Z]+$
  • Yes, that will work fine.

    And if you are able to set a case insensitivity modifier (probably i), the regex could even be shortened to: ^[a-z]+$
  • @Meta_Ing, Thanks for your quick response and clarification.