July 18th, 2012, 12:46 AM
[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.
July 20th, 2012, 09:29 PM
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.
July 20th, 2012, 09:58 PM
Or you use RegexOptions.Multiline so that dot-all will include newlines.
Comments on this post
July 21st, 2012, 01:16 PM