Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding a RegEx expression
Message
From
11/03/2014 14:38:31
 
 
To
11/03/2014 14:18:41
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:
01596120
Message ID:
01596132
Views:
36
>>I don't think you have to do anything, but it just triggers on when you type the normal input. The highlighted portions are shown in alternating colors.
>
>So, yellow means it validates OK I guess.

I think the coloring in the expression portion is just syntax highlighting. It helps break out the parts separate parts move visibly. The coloring in the section below indicates portions that would be extracted / noted by the RegEx.

>BTW, what would be your interpretation on:
>([A-Za-z0-9-]{1,20})-([A-Za-z0-9]{1,12})
>([A-Za-z0-9-]{1,20})-([A-Za-z0-9]{1,4})
>If you would code it, for example, what would be the logic in place?

I'm not sure what you mean. The { } parts indicate how large of a grouping (should the matched text be longer) to include.

>When I first looked at the first one, I thought this meant alphanumeric characters + a dash
>character in all characters from 1 to 20 MINUS alphanumeric only in the first 12 characters.
>Which means, the dash would have been accepted only from position 13th and up.
>
>But, support gave me information that this means the dash is supported from position 2 and up.
>I really do not know what to believe now.

I don't know here either. I try to avoid RegEx expressions in general, or find ones I need on Stack Overflow. :-) I've often found that a dozen or so lines of regular source code can replace the single RegEx, thereby making it easier to maintain. :-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform