Results 1 to 4 of 4

Thread: Regex results to string[]

  1. #1

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    Regex results to string[]

    I'm looking to populate a string array with the results from a regex query on a lump of text ( html)


    I'm not familar with how regex works and I'm finding it confusing the difference between match and matches and why I use the results to directly or indirectly ( loop) drop data into a array

  2. #2

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    Re: Regex results to string[]

    anyone?

  3. #3
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: Regex results to string[]

    Normally if you parse a Regular expression the results can be get in many ways. One of them is the MatchCollection

    Represents the set of successful matches found by iteratively applying a regular expression pattern to the input string.
    And the Match is the Individual match in the Match Collection.

    MSDN
    Please mark you thread resolved using the Thread Tools as shown

  4. #4
    Fanatic Member stlaural's Avatar
    Join Date
    Sep 2007
    Location
    Quebec, Canada
    Posts
    683

    Re: Regex results to string[]

    Here's another MSDN page with a C# example.

    If you use the Match Collection like suggested by danasegarane you might not event need the String array you mere mentionning.
    Alex
    .NET developer
    "No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)

    Things to consider before posting.
    Don't forget to rate the posts if they helped and mark thread as resolved when they are.


    .Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
    My fresh new blog : writingthecode, even if I don't post much.

    System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x27" and 1x23" LCDs, Windows 10 x64, ]VS2015, Framework 3.5 and 4.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width