Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another RegEx expression
Message
De
11/03/2014 19:24:26
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01596156
Message ID:
01596192
Vues:
33
>If you need to limit the total characters to 20 you will need to use a look ahead expression, for example:
>
>^(?=(([A-Z0-9]){1,20})-(([A-Z0-9]){1,12})).{1,20}$
>
>paste that expression in regex tester and you'll see that all of this lines get validated:
>
>A-B
>0-B
>ABC0000-DEF000000000
>1E-1C
>A1-B2
>1234567890123456-DEF
>12345678901234567-01
>AA-AB
>12E345678901-A
>
>But as soon as you go out of the 20th char (total) they will not get validated (you can play with {1, 20} to see how it changes.
>
>Quickly googling I found this tutorial that I think explains lookahead (and lookbehind) quite well

Thanks, this is very good.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform