Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27020

VS 2012 Regex Help!

$
0
0
I have the following regular expression that I am writing ...

<page\s[^>]*?(?<=\s)title\s*?=\s*?(?<tag>'|")(?<Title>.+?)\k<tag>


This gets elements from html like syntax in this case it gets the title value from the page element (will match it to the title group)...

I need to to work in a multitude of situations and it will currently work for the following situations:

<page someproperty="asd" title="hello">
<page someproperty="asd" title="hello">


However I also want it to work when there are NO quotation marks such that:

<page someproperty="asd" title=hello>

Will match too...

I can't for the life of me figure this one out!

Thanks,
Kris

Viewing all articles
Browse latest Browse all 27020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>