Regular Expressions 101

Community Patterns

hex number check

2

Regular Expression
PCRE (PHP <7.3)

/
(?:0[xX])?[0-9a-fA-F]+
/

Description

check if a string is a hex number

Submitted by anonymous - 8 years ago