Urgent! regular expression test!

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

    #1

    Urgent! regular expression test!

    Hi,

    How can i test whether a string starts with an "_" or "-".
    let me know the earliest possible

  • Martin Honnen

    #2
    Re: Urgent! regular expression test!



    learner wrote:

    [color=blue]
    > How can i test whether a string starts with an "_" or "-".[/color]

    /^[_\-]/.test(string)

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    Working...