Q:

Picking data inside a string via reflex

Okay i have been trying to pick some data from a string with reflex(in c#) for a while, basically i want to pick everything between Customer and <\div> but i dont seem to be able to get the data:
my code:
   string text= "<div> Company = Fake Company </div><div>Customer: XXXX</div><div>Device: NY-FIL05 </div><div>Service: Device     Fail:</div> "
   var groups= Regex. Match(text, @"Customer: (.*\b</\div>\b")).Groups;
   var auxi = groups[1].Value;

basically i need to grab XXXX but im  always either grabbing everything or grabbing nothing

A:

string text = "<div> Company = Fake Company </div><div>Customer: XXXX</div><div>Device: NY-FIL05 </div><div>Service: Device     Fail:</div>";
Match m = Regex. Match(text, @"(?<=Customer: ).*?(?=</div>)");
if (m.Success)
    Console. WriteLine(m. Value);

Explanation:
(? <=Customer: ).*?(?=</div>)

Debuggex Demo

