Try the following:
var output = Regex.Replace(input, @"[\d-]", string.Empty);
The \d
identifier simply matches any digit character.
More Related Contents:
- RegEx to remove single quote, parentheses or square bracket from both beginning and end of a string [closed]
- How do I match an entire string with a regex?
- How to match hyphens with Regular Expression?
- Regex Email validation
- How do I replace multiple spaces with a single space in C#?
- Regular expression to remove HTML tags
- Replace only some groups with Regex
- What’s the difference between “groups” and “captures” in .NET regular expressions?
- Best Regular Expression for Email Validation in C#
- Number of occurrences of a character in a string [duplicate]
- Using WebClient in C# is there a way to get the URL of a site after being redirected?
- Pad left with zeroes
- Negating specific characters in regex
- Fixed Length Regex Required?
- Regex split string but keep separators
- RegEx – reusing subexpressions
- Case insensitive Regex without using RegexOptions enumeration
- Regex nested parentheses
- Ignoring white space for a Regex match
- Validating file types by regular expression
- How to make a regex match case insensitive?
- How to remove empty lines from a formatted string
- Regex for Money
- Get values between curly braces c#
- Regular expression where part of string must be number between 0-100
- Regex to get src value from an img tag
- Replace non-numeric with empty string
- Regular expressions C# – is it possible to extract matches while matching?
- Parsing formatted string
- is there a elegant way to parse a word and add spaces before capital letters