Got more questions? Find advice on: ASP | SQL | XML | Windows
Welcome to RegexAdvice Sign in | Join | Help

Re: Validation pattern for a text box?

  •  03-07-2007, 9:10 AM

    Re: Validation pattern for a text box?

    First I will let you know, that you should give a better description of what you want. Do you need to know how to do the javascript or the regex or both?  Should a single letter be a match? I assume that you need at least 2 values for it to be a match, and I am also just guessing that when you say single spaces you will allow more than one single space in a row? If I am wrong let me know. Either way give this a shot.

    I don't use Javascript much anymore, but I think you would do something like this: 

    re = new RegExp("[a-zA-Z][a-zA-Z0-9 ]+");

    mymatch = myregexp.exec(theText)

    Hope that helps,

    Brendan 

View Complete Thread