Skip to content

Instantly share code, notes, and snippets.

@mariusschulz mariusschulz/Digits.cs
Last active Nov 4, 2015

Embed
What would you like to do?
A list of characters that the regular expression pattern \d matches in .NET.
var digitRegex = new Regex(@"\d");
IEnumerable<char> digitCharacters = Enumerable
.Range(1, Char.MaxValue)
.Select(Convert.ToChar)
.Where(c => digitRegex.IsMatch(c.ToString()));
0
1
2
3
4
5
6
7
8
9
٠
١
٢
٣
٤
٥
٦
٧
٨
٩
۰
۱
۲
۳
۴
۵
۶
۷
۸
۹
߀
߁
߂
߃
߄
߅
߆
߇
߈
߉
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.