Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another RegEx expression
Message
From
11/03/2014 18:18:31
 
 
To
11/03/2014 18:15:30
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01596156
Message ID:
01596188
Views:
33
>([A-Za-z0-9]{1,18})-([A-Za-z0-9]{1,18}) is probably more accurate, but I can't say for sure. My assumption is that it is supposed to be 1 or more alphanumeric characters, followed by a single hyphen, followed by 1 or more alphanumeric characters. If there has to be 1 or more characters before and after the hyphen and the length is known to be 20, the other side can have at most 18 characters.

That's probably what it should be. This mask was sent to me on a test item. So, maybe it hasn't been fully tested.

Thanks for the additional explanations

>Also, while the expression could match a string up to 41 characters long (37 in the revision), if you know the max length is 20, the additional characters aren't going to matter. If you couldn't make this assumption the regex becomes much more complicated if you try to ensure that it is a specific size and has exactly 1 hyphen at an unknown position in the string.

Ok
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform