regex - C# regular expression (replace) -


assume have string:

10,11,12,13,14,abc,def,ghi,66

i looking run regex against return 0-9 , "," characters, stripping else out.

i have looked @ regex.replace, isn't quite right it. code below:

regex reg = new regex(@"[0-9,]+"); string input = reg.replace(input, delegate(match m)                 {                     return string.empty;                 }); 

how can make work?

do want ^ in that?

input = regex.replace(input, @"[^0-9,]+", ""); 

Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -