x Did you like it? Well, then please consider making a donation :)

Regex.Matches, Regular Expression for hexadecimal number

Matches expression starting with a 0, following by either a lower or uppercase x, followed by one or more characters in the ranges 0-9, or a-f, or A-F.

Tags: #const, #constants, #cpp, #flags, #hex, #hexadecimal, #math, #number, #parsing. Views: 6881. stackoverflow, 8/14/2015
Link 1: http://www.systemtextregularexpressions.com/m21/regex.matches-regular-expression-for-hexadecimal-number
Link 2: http://www.systemtextregularexpressions.com/m21 (short)

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

RegexOptions

IsMatch=true


#ValueIndexLengthGroupsCaptures
00x0006686Skip Navigation Links.
Expand Groups [2]Groups [2]
Skip Navigation Links.
Expand Captures [1]Captures [1]
10x001C936Skip Navigation Links.
Expand Groups [2]Groups [2]
Skip Navigation Links.
Expand Captures [1]Captures [1]
20x80001106Skip Navigation Links.
Expand Groups [2]Groups [2]
Skip Navigation Links.
Expand Captures [1]Captures [1]
30x00071326Skip Navigation Links.
Expand Groups [2]Groups [2]
Skip Navigation Links.
Expand Captures [1]Captures [1]
40x000F1516Skip Navigation Links.
Expand Groups [2]Groups [2]
Skip Navigation Links.
Expand Captures [1]Captures [1]
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
0015
0016
//.NET Regex.Match Online Tester: www.systemtextregularexpressions.com

//Namespace
using System.Text.RegularExpressions;

//Regex Pattern
string pattern = @"(0[xX][0-9a-fA-F]+)";

//Regex example #1
Regex r = new Regex(@"(0[xX][0-9a-fA-F]+)");
Match m1 = r.Match("input text");
MatchCollection mc1 = r.Matches("input text");

//Regex example #2
Match m2 = Regex.Match("input text", @"(0[xX][0-9a-fA-F]+)");
MatchCollection mc2 = Regex.Matches("input text", @"(0[xX][0-9a-fA-F]+)");
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
'.NET Regex.Match Online Tester: www.systemtextregularexpressions.com

'Namespace
Imports System.Text.RegularExpressions

'Regex Pattern
Dim pattern As String = "(0[xX][0-9a-fA-F]+)"

'Regex example #1
Dim r As Regex = New Regex("(0[xX][0-9a-fA-F]+)")
Dim m1 As Match = r.Match("input text")
Dim mc As MatchCollection = r.Matches("input text")

'Regex example #2
Dim m2 As Match = Regex.Match("input text", "(0[xX][0-9a-fA-F]+)")
Dim mc2 As MatchCollection = Regex.Matches("input text", "(0[xX][0-9a-fA-F]+)")

Home     Match     Replace     Split     Help     Library     Contacts     netregex rss

Made by Koshevoy Dmitry [8Bytes],

© 2014-2024 Ukraine, Nikolaev.