Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2016-03-20 07:50
Flavor·PCRE (Legacy)

/
(?<sign>[-+]?)(?<value>(?<hex>0x[0-9a-f]+)|(?<oct>0[0-7]+)|(?<dec>[0-9]+))(ul|l|u)?
/
gmi
Open regex in editor

Description

Grabs any C-style integer, including sign, prefix(0x for hex, 0 for octal), and suffix(U, L, UL)

Submitted by Daun Jeong