Regular expression - help needed

Discussion in 'Java' started by Chanchal, Dec 13, 2005.

  1. Chanchal

    Chanchal Guest

    Hi ,

    this might sound silly, i'm using
    org.apache.commons.validator.GenericValidator class, for some
    validation. I need to check if a string contains only alphabets. i
    wrote the code as

    org.apache.commons.validator.GenericValidator.matchRegexp(value,
    "[a-zA-Z]")

    but it is not workiing. Please advice

    Chanchal
    Chanchal, Dec 13, 2005
    #1
    1. Advertising

  2. Chanchal

    NullBock Guest

    try GenericValidator.matchRegexp(value, "^[a-zA-Z]+$")


    Walter Gildersleeve
    Freiburg, Germany

    ______________________________________________________
    http://linkfrog.net
    URL Shortening
    Free and easy, small and green.
    NullBock, Dec 13, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VSK
    Replies:
    2
    Views:
    2,267
  2. David Cho
    Replies:
    4
    Views:
    390
    David Cho
    Feb 15, 2005
  3. pekka niiranen
    Replies:
    5
    Views:
    504
    Paul McGuire
    Oct 20, 2004
  4. ragz_82
    Replies:
    1
    Views:
    292
    ragz_82
    Aug 4, 2009
  5. Gianni B.

    regular expression help needed

    Gianni B., Sep 6, 2004, in forum: ASP General
    Replies:
    0
    Views:
    96
    Gianni B.
    Sep 6, 2004
Loading...

Share This Page