I have this string:
Hello22, I'm 19 years old
I just want to replace the number with * if its preceded with a space, so it would look like this:
Hello22, I'm ** years old
I've been trying a bunch of regexes but no luck. Hope someone can help out with the correct regex. Thank you.
Regexes which I tried:
Regex.Replace(input, @"([\d-])", "*");
Returns all numbers replaced with *
Regex.Replace(input, @"(\x20[\d-])", "*");
Does not work as expected