Community Patterns

Community Library Entry

1

Regular Expression
Created·2025-01-04 20:56
Flavor·PCRE2 (PHP)

/
(?<![\.\d])[\d,]*[02468](?(?!\.)|\.[0]*$)
/
gm
Open regex in editor

Description

Detects even numbers in any string:

ex. Hello, I'm 18 years old. ex. 17.02 (not detected)

Submitted by anonymous