x Hint: Register, if you want to hide ads.
x Did you like it? Well, then please consider making a donation :)

Simple Regex.Split sample - remove digits

User \d+ for remove digits and \D+ for remove text.

Tags: #digits, #simple, #split. Views: 1820. admin, 3/30/2015
Link 1: http://www.systemtextregularexpressions.com/s4/simple-regex.split-sample-remove-digits
Link 2: http://www.systemtextregularexpressions.com/s4 (short)

Length: 0b, Line: 1, Cursor: 0

RegexOptions

IsMatch=true


#Value
0Why
1 do
2 you
3 cry
4 Willy?
Count: 5, Time: 00:00:00

Share (without adding to database):

Source code

0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
//.NET Regex.Split Online Tester: www.systemtextregularexpressions.com

//Namespace
using System.Text.RegularExpressions;

//Regex Pattern
string pattern = @"\d+";

//Regex example #1
Regex r = new Regex(@"\d+");
string[] result1 = r.Split("input text");

//Regex example #2
string[] result2 = Regex.Split("input text", @"\d+");
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
'.NET Regex.Split Online Tester: www.systemtextregularexpressions.com

'Namespace
Imports System.Text.RegularExpressions

'Regex Pattern
Dim pattern As String = "\d+"

'Regex example #1
Dim r As Regex = New Regex("\d+")
Dim result1() As String = r.Split("input text")

'Regex example #2
Dim result2() As String = Regex.Split("input text", "\d+")

Home     Match     Replace     Split     Help     Library     Contacts     netregex rss

Made by Koshevoy Dmitry [8Bytes],

© 2014-2017 Ukraine, Nikolaev.