Grow your CSS skills. Land your dream job.

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

  • # June 3, 2012 at 2:18 am

    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]+$
    # June 3, 2012 at 2:41 am

    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]+$

    # June 3, 2012 at 2:55 am

    @Meta_Ing, Thanks for your quick response and clarification.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".