Regular expression

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chadrahul
    New Member
    • May 2010
    • 2

    #1

    Regular expression

    Regular expression to

    accept only numbers with max 2 dashes (no 2 dashes together)
    i.e.
    123-345-567 YES
    Or
    -123345567- YES
    Or
    --123456789 NO
    Or
    As1234567 NO
    Or
    #355534gg NO
    Etc.
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    You couldn't even bother making your own effort first?
    I see no code attempt to do this on your own before asking for help.

    Here are some good RegEx resources
    A Regular Expressions Reference
    Online RegEx builder
    Online RegEx tester

    Comment

    Working...