c# - Regex help for this expression with digits wanted -
i splitting given text wherever eachdeleteddeleted occours, of files contain text like:
each2,deleted6,deleted eachdeleted2,deleted each5,deleted15,deleted each5,deleted5,deleted2 i want regex replace , turn these expressions eachdeleteddeleted.
i have tried using follow code:
regex ra = new regex(@"eachdeleted\d, deleted"); matchcollection mcmatches = ra.matches(extracted); foreach (match m in mcmatches) { if (m.success) { // messagebox.show(m.value.tostring()); richtextbox5.text += "jjjj------>" +m.value + "\n"; } } but i'm not getting matches.
the regex each\d*,*deleted\d*,deleted\d* matches sample data:
each2,deleted6,deleted
eachdeleted2,deleted
each5,deleted15,deleted
each5,deleted5,deleted2
if lack of comma in second line typo, use each\d*,deleted\d*,deleted\d*
basically, \d matches digit , * means 0 or more times.
Comments
Post a Comment