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

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

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -