c# - Picking data inside a string via reflex -
okay have been trying pick data string reflex(in c#) while, want pick between customer , <\div> dont seem able data: 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 need grab xxxx im either grabbing or grabbing nothing
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>)
Comments
Post a Comment