[c#] Problem with a regex

D

dz

Hi,
I'have a problem with the following code that I've put in a aspx page:

Regex exp = new Regex(@"(hello).* (border).*");
Match m = exp.Match("sdf <table border hello>");

i=m.Index;

return i;

I want to pass a html page to this function, and, if all is workly
correctly, i want that this code return the position of the match in the
html (that is in a string..).

In the example the code must return 4.

I have test the regexp outside c# and is working, but, in this code, the
function return always 1 like index.

Who can help me? Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top