I have a string that contains numbers and other characters like: 123\n456? * ,, ;;; '' 333\n789/\\+-
and I'm trying to get only the numbers from it as array like
123
456
333
789
I've tried something like
serials = Regex.Replace(serials, @"\r\n?|\n|\t", " ");
var serialNumbers = Regex.Split(serials, @"(?<!($|[^\\])(\\\\)*?\\);");
but my array has something like
123 456? * ,,
empty
empty
'' 333 789/\\+-
Is there a way to split this string correctly?