c# - Regular Expression: Span and ID dynamic -



c# - Regular Expression: Span and ID dynamic -

this regular look in c# doesn't work:

regex regexspan = new regex("<span class=\"test\" id=\"" + value + "\">"(.*?)</span>", regexoptions.compiled | regexoptions.ignorecase);

i want search span id indicate dynamically. text within tag can either.

can help me find error in regular expression?

regards.

you set ending-quote mark after first > sign. regex should like:

"<span class=\"test\" id=\"" + value + "\">(.*?)</span>"

notice in html, class attribute doesn't come before id attribute, code work in specific cases.

c# regex

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -