c# - Regular expressions match not working accurately with semicolon -
c# - Regular expressions match not working accurately with semicolon -
i have string of codes like:
0926;0941;0917;0930;094d; i want search for: 0930;094d; in above string. using code find string fragment:
static bool exactmatch(string input, string match) { homecoming regex.ismatch(input, string.format(@"\b{0}\b", regex.escape(match))); } the problem code works , not. if match single code example: 0930; , works when add together 094d; , skips match.
how refine code work accurately semicolons?
try this, have tested..
string val = "0926;0941;0917;0930;094d;"; string match = "0930;094d;"; // or match = "0930;" both found if (regex.ismatch(val,match)) console.write("found"); else console.write("not found"); c# c#-4.0 .net-4.0
Comments
Post a Comment