c# - Regex On Text Producing Empty Value -



c# - Regex On Text Producing Empty Value -

i trying utilize regex on line of text values of name=.

var match = regex.match(textr, @"\bname='([^']*?)'");

the value of textr in question

$mpelement[name="system.workitem.incident.queue.tier2.unassigned.view.header_id"]$

but brings {}

do this:

resultstring = regex.match(yourstring, @"(?<=name="")[^""]+").value; the lookbehind (?<=name=") ensures preceded name=" the negative character class [^"] matches character not double quote the + quantifier matches such chars 1 or more times

c# regex

Comments

Popular posts from this blog

ruby on rails - Devise Logout Error in RoR -

model view controller - MVC Rails Planning -

php - Working with pretty urls on apache and fastcgi after hhvm installation -