#1
  1. No Profile Picture
    Dim Brendan as Noob
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    475
    Rep Power
    506

    [VB 2008] Searching Multiple Lines Using Regex


    Hello. I am using Visual Basic 2008 and I am having a problem searching with regular expressions.

    I am searching through some HTML from a mmorpg website and am trying to get names and statistics from a table. I am using the regex look ahead to find "Successful Attacks Today" and the end of the string should be the end of the table, so (?=\/table)

    From there I will search through that string and pick out the data I need.

    Problem is I am trying to figure out how to search through multiple lines. I know that \n searches a line break and .+ searches everything but line breaks but I need to combine them both.

    I can't find anything that searches through EVERYTHING until it identifies the lookbehind.

    Thank you in advance for your help.
  2. #2
  3. No Profile Picture
    Dim Brendan as Noob
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    475
    Rep Power
    506
    No one replied here. To anyone using the search feature what I ended up doing was a regex replace of my responseFromServer string taking out any VBNewLine's detected and replacing them with VBNullString. From there I searched through the string like I normally would.

    Workarounds for everything.
  4. #3
  5. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    Or you use RegexOptions.Multiline so that dot-all will include newlines.

    Comments on this post

    • Brendan.C agrees : Thanks
  6. #4
  7. No Profile Picture
    Dim Brendan as Noob
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    475
    Rep Power
    506
    Aha!

    Many thanks.

IMN logo majestic logo threadwatch logo seochat tools logo