regular expression tag

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Bass

    #1

    regular expression tag

    Once before i saw something where you had some regular
    expression, with some sort of tag in it, so a match could
    be easily referenced by the "Groups" property, rather
    than going by an index...

    "[\w]+\s*[\d]+"

    instead of saying myMatch.Groups[0], it would be like

    "{First}[\w]+\s*{Second}[\d]+"

    and then reference myMatch.Groups["First"]...

    is this remotely an existing concept?

    Thanks
    Dan.

  • Roberto Martinez-Brunet

    #2
    Re: regular expression tag

    Daniel,

    (?<First>[\w]+\s*)(?<Second>[\d]+)

    R-o


    Comment

    • Daniel Bass

      #3
      Re: regular expression tag

      Don't worry, i looked a bit more and found a solution....




      "Daniel Bass" <anonymous@disc ussions.microso ft.com> wrote in message
      news:003201c3b9 b9$0aabdeb0$a30 1280a@phx.gbl.. .
      Once before i saw something where you had some regular
      expression, with some sort of tag in it, so a match could
      be easily referenced by the "Groups" property, rather
      than going by an index...

      "[\w]+\s*[\d]+"

      instead of saying myMatch.Groups[0], it would be like

      "{First}[\w]+\s*{Second}[\d]+"

      and then reference myMatch.Groups["First"]...

      is this remotely an existing concept?

      Thanks
      Dan.


      Comment

      Working...