Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Regex pattern cannot start or end with hyphen
ocon - 2:05 am on Aug 20, 2013 (gmt 0)A string must be between 1 to 255 characters in length.
I'm having difficulty writing the regex for this pattern:
A string can only contain a-z, 0-9, or a hyphen.
A hyphen cannot follow another hyphen.
A string cannot start or end with a hyphen.I'm finding the last two parts the most challenging. What I have so far is:
Thread source:: http://www.webmasterworld.com/php/4603466.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com