
Untitled
By: a guest on
May 9th, 2012 | syntax:
None | size: 0.58 KB | hits: 15 | expires: Never
regular expression for spaces and words
<div>
<asp:HyperLinkField HeaderText="Hello World of Regular Expression" />
</div>
//This one gets me close but doesn't get me strings with spaces in them
var match = Regex.Match(tokens[1], @"HeaderText=""(w+)""");
//This was suggested below. It shows correct match count but values are just empty strings
var match = Regex.Match(tokens[1], @"HeaderText=""[^""]+""|[w]+");
if (match.Success)
{
yield return new KeyValuePair<string, string>(
file, match.Groups[1].Value //This is empty for 2nd scenario
);
}
"[^"]+"|[w]+