# Deleting non-numeric characters from a String

**URL:** <https://forum.xojo.com/t/deleting-non-numeric-characters-from-a-string/88799>\
**Category:** Getting Started\
**Created:** [August 25, 2026, 5:53pm UTC](https://forum.xojo.com/t/deleting-non-numeric-characters-from-a-string/88799 "2026-08-25T17:53:53Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Sascha\_S](https://forum.xojo.com/user_avatar/forum.xojo.com/sascha_s/32/22328_2.png) [@Sascha\_S](https://forum.xojo.com/u/Sascha_S)\
**Post date:** [August 26, 2026, 7:23am UTC](https://forum.xojo.com/t/deleting-non-numeric-characters-from-a-string/88799/4 "2026-08-26T07:23:02Z")

</div>

What if the number is a decimal number? 🙂

```auto
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

```

---

_[View the full topic](https://forum.xojo.com/t/deleting-non-numeric-characters-from-a-string/88799)._
