Originally Posted by
nvoigt
Well, first of all this isn't C++, but C++/CLI. There are good reasons to use .NET and good reasons to use native C++ but I can guarantee that you don't have a valid reason to use C++/CLI. C++/CLI combines the drawbacks of both. It's the cryptic C++ syntax combines with the inferior .NET performance.
Anyway... where does it fail? All you told us is that "it doesn't work". I can see that you catch and silently swallow any exception so for all we know it could crash in the very first line. Have you set a breakpoint and checked what happens? How many matches are in the collection?
I am using C++/CLI, so I don't see anything wrong with between unmanaged C++ and managed C++/CLI.
However, I have put the breakpoint in this line:
Code:
String ^pattern1 = listView1->SelectedItems[0]->SubItems[1]->Text + "(<p id='images'>(.*?)</p>)";
I can see that I have got an undefined value.
When I tried this:
Code:
String ^ pattern1 = listView1->SelectedItems[0]->SubItems[1]->Text;
I have found my matched strings from the http request and the listview without using the regex pattern, so when I tried this:
Code:
String ^ pattern1 = listView1->SelectedItems[0]->SubItems[1]->Text + "(<p id='images'>(.*?)</p>)";
I did not get the returned strings, so what i am trying to do is to find the matched strings that I selected in the listview and find the html tags called images, then extract the link from the tags, e.g:
Code:
<p id="images"> <a href="images.php?id=1">Images</a>
I want the return strings to be like this:
PHP Code:
www.mysite.com/images.php?id=1
Any idea how I can do this?
Thanks in advance.