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

Question about regex in a specific pattern

Last post 07-05-2008, 11:37 AM by ddrudik. 1 replies.
Sort Posts: Previous Next
  •  07-05-2008, 10:07 AM 43784

    Question about regex in a specific pattern

    I wanna create a regex for a string can be with multi dash within a string optionally,

    1. dash cannot place in first / last position

    2. dash cannot be placed continously

    Acceptable string: happy1231, asfa12312-asdf, asdf-asdfs-f-d-d-d-d-d, asd7976-asdf-asdfsa-d

    Hope someone would give me a hand here. Thank you. Big Smile

  •  07-05-2008, 11:37 AM 43785 in reply to 43784

    Re: Question about regex in a specific pattern

    ^(?:(?!^-|-{2,}|-$).)*$
View as RSS news feed in XML