public void test() { Regex numR = new Regex(@"\d"); Regex strR = new Regex(@"\D"); string testStr = "asdfasdf8asdfasdf9adsfasd9"; var temp2 = strR.Matches(testStr); string resultNum = ""; string resultStr = ""; foreach (Match item in numR.Matches(testStr)) { resultNum += item.Value; } foreach (Match item in strR.Matches(testStr)) { resultStr += item.Value; } Response.Write(resultNum + "|" + resultStr); }