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

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - cuda, pycuda -- how to write complex numbers -- errors:class "cuComplex" has no member "i" -

How do I check if an insert was successful with MySQLdb in Python? -