Urgent! regular expression!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • learner

    Urgent! regular expression!

    Hi,

    How to find a word is containing only alphabets, numbers, _ and -?
    Also,It should not start with _ and -?
    How abt testing with this exp - /^(\w|\d)(\w|\d|-|_)+$/; ?

  • Randy Webb

    #2
    Re: Urgent! regular expression!

    learner wrote:
    [color=blue]
    > Hi,[/color]

    Hi, this is your thind "Urgent!" this morning. Is it homework?
    [color=blue]
    > How to find a word is containing only alphabets, numbers, _ and -?[/color]

    With a regular expression.
    [color=blue]
    > Also,It should not start with _ and -?[/color]

    Then test for that.
    [color=blue]
    > How abt testing with this exp - /^(\w|\d)(\w|\d|-|_)+$/; ?[/color]

    How about *you* testing with that exp? Its not that hard.



    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    Working...