RobertP Posted June 19, 2012 Share Posted June 19, 2012 i need to make sure my string does NOT end with a dash '-'. /^&[a-zA-Z0-9-]{3,}$/ Any help would be greatly appreciated! Quote Link to comment Share on other sites More sharing options...
Andy-H Posted June 19, 2012 Share Posted June 19, 2012 /^&[a-zA-Z0-9-]{3,}[^-]$/ //Edit If you meant ends with an alpha-numeric character, this rule matches '&' followed by AT LEAST 2 alphanumeric and hyphen characters, followed by one or more alphanumeric character /^&[a-zA-Z0-9-]{2,}[a-zA-Z0-9]+$/ Quote Link to comment Share on other sites More sharing options...
RobertP Posted June 19, 2012 Author Share Posted June 19, 2012 /^&[a-zA-Z0-9-]{3,}[^-]$/ Thank you so much.. i was playing around with this :S /^&[a-zA-Z0-9-](?!-){3,}$/ Quote Link to comment Share on other sites More sharing options...
Andy-H Posted June 19, 2012 Share Posted June 19, 2012 Please see my edit, the patten you quoted will match & followed by 3 or more alpha-numeric / hyphen characters followed by ANYTHING but a hyphen i.e. &75gg45g---54g-g54g% Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.