Deleting non-numeric characters from a String

What if the number is a decimal number? :slight_smile:

dim rx as new RegEx
rx.SearchPattern = "(?mi-Us)\d+([.,]\d+)?"

dim rxOptions as RegExOptions = rx.Options
rxOptions.MatchEmpty = false
rxOptions.StringBeginIsLineBegin = false
rxOptions.StringEndIsLineEnd = false

dim match as RegExMatch = rx.Search( sourceText )
while match isa RegExMatch
//
// Do something like myVar = match.SubExpressionString(0).ToDouble
//

match = rx.Search // Fetch the next match
wend