Question Problem with Regex.split(input, pattern)

andyvl

Member
Joined
May 14, 2009
Messages
14
Programming Experience
Beginner
Hello,

I'm having troubles with the Regex options.

I'm writing a program to retrieve info from an intranetpage
so my input is the sourcecode of a webpage.

Now I need to retrieve info and I want to have the text split.

garbage

Operations (France Paris)
<table>.........<\table>

Operations (India Chennai)
<table>.......<\table>
(note, there are only 5 countries we work with)

garbage



Now I want to find a way to have the string searched and put it in a string()

So search the string for Operations (one of the 5 possible countries) if it occures, split until the next </table>


But I can't even get the regex to find the pattern "operations (india chennai)"
I've been messing with escapechars etc but he just don't cut the string


VB.NET:
   Dim searchPattern As String = "(\btitles)"
   Dim tmp() As String = Regex.Split(tekst, SearchPattern)
tekst is from the type String and contains the full sourcecode of the webpage



Can somebody please help me and put me on the right track
 
For the moment I'm trying a workaround.
(not very performant but I don't think regex is the best sollution for my problem. (certainly not in 1 command)

so for the moment I managed to split on the html tag <table>

I receive a lot of garbage strings but now the strings I need to get info of start with 'operations xxxx' so now I can make a check
if the string.startswith("Operations xxx") and do actions accordingly.
 
I find the regex a real pain in the ass



what I want is that my string is splitted after the exact combination of bellow special chars
;">

but I don't manage to get the " sign in my pattern. Tried ascii value (")
can please somebody tell me how to get the " sign in my regex pattern
 
Back
Top