+2  A: 

Your regular expression should be:

<a class="darklink" .*?>(.*?). - (.*?)</a>

or if you get line breaks inside your <a> tag:

<a class="darklink" [\s\S]*?>([\s\S]*?). - *([\s\S]*?)</a>

So, following code should works:

Regex person = new Regex(@"<a class=""darklink"" .*?>(.*?). - (.*?)</a>");
foreach (Match m in person.Matches(input))
{
    Console.WriteLine("First group : {0}", m.Groups[1]);
    Console.WriteLine("Second group: {0}", m.Groups[2]);
};
Rubens Farias
thank you for helping, but this currently doesn't work :(, i don't know why
snarebold
according your sample data, note I expect "any character, space, minus, space" between name and status; can you please check provided sample?
Rubens Farias
i tested it in expresso :S, could it be anithing with the whitespaces?
snarebold
@snarebold: please also check if there are line breaks inside your <a> tag
Rubens Farias
i checked, works still not hmmm. I'm confused :)
snarebold
please, try also this: <a class="darklink" [\s\S]*?>([\s\S]*?). *- *([\s\S]*?)</a>
Rubens Farias
i wrote it in expressoregex : <a class="darklink" .*?>(.*?). - (.*?)</a>and as sample text just the link and it works not.
snarebold
Yes, it is likely there are line breaks that are not matched by the DOT. @snarebold try adding `(?s)` at the start of your regex. But, what about using an html parser to get all `table`'s and then parse those for `a` tags?
Bart Kiers
@snarebold: also tried with expresso and works! please, try to use HTML from your question as sample text
Rubens Farias
strange, works not :)...
snarebold
as sample text i just use now <a class="darklink" href="testlink">Person 2, - Status of Person 2</a>and still works notregex is: <a class="darklink" [\s\S]*?>([\s\S]*?). - *([\s\S]?)</a>
snarebold
SO removed an important char; please refer to second regex in my edited answer
Rubens Farias
my whoe project is a webcrawler with c# and it makes all in backgroundi have to save up the data in a DB. @Bart, how would you easy parse html with c# without regex?
snarebold
it also doesn't work with your second link. other expressions work which so a bug of expresso could not be:)--> http://img504.imageshack.us/img504/7753/regex.jpg
snarebold
I really dont know whats going on; can you please try to run it in your asp.net application, or test that expressions inside 'Rad Software Regular Expression Designer' ?
Rubens Farias
ok i try in my app
snarebold
uaaaaaaaaa.... it still doesnt work.... damn shit expressions... im tired :(.. really thx you help me .. I have to finish this today :S
snarebold
sry man, good luck =/
Rubens Farias
you are sure with this regex it works?, thx :)
snarebold
yes; tried inside Rad, Expresso, and in my C# code
Rubens Farias
i got it.. there was a f**** checkbox in expresso..really thanks
snarebold