In article <ev3CpU#(E-Mail Removed)>, Jg wrote:
> is it OK to get regex result of pattern which has duplicate reference names
> like
> StrDatePattern As String
> ="\b(((?<year>\d{4})-(?<month>\d{1,2})-(?<day>\d{2}))|{(?<month>\d{1,2})
> (?<day>\d{2}), (?<year>\d{4})))"?
>
Yes. In this case, once you've debugged the regular expression, you'll find
that each named capture is matched at most one time by the pattern. The .NET
will also handle multiple matches.
I'd suggest running your regular expression through a tool (like the online one
at
http://www.regexlib.com/RETester.aspx) so you can see what's happening
visually.
Hope this helps.
Mike
PS: It's good practice to have checked at least the syntactic validity of your
code before you post.