Skip to content

Instantly share code, notes, and snippets.

@mariusschulz
Last active November 4, 2015 16:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariusschulz/dff85f5f4e649dcb5fe0 to your computer and use it in GitHub Desktop.
Save mariusschulz/dff85f5f4e649dcb5fe0 to your computer and use it in GitHub Desktop.
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