Regular Expressions 101

Matches All the even numbers

Open Workspace
  • PCRE2 (PHP)
  • Match
1

Regular Expression

/
\b(?:\d+)?[24680]\b
/
gm

Description

Matches all the even numbers from a given input.

Submitted by Dashrath Sharma