#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2008
    Posts
    369
    Rep Power
    55

    Question Javascript Match


    I want to test for alphanumeric strings which allows spaces. Must start with a letter however. Length must be between 3-25 chars.

    My regex is:

    PHP Code:
    var = /^[A-Za-z]{1}[A-Za-z0-]{2,24}$/
    p.test('testing'); //returns true
    p.test('more testing'); //returns false 
    What am I missing? Thanks for the help.
    Last edited by studeoc; May 19th, 2010 at 02:39 AM.
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,179
    Rep Power
    9398

IMN logo majestic logo threadwatch logo seochat tools logo