Regular Expressions 101

Community Patterns

Find OTP

0

Regular Expression
PCRE2 (PHP >=7.3)

/
((?<=is).[0-9]{4,8}.(?=is)?)|(^[0-9]{4,8}.(?= is))
/
gm

Description

Covers most of the cases of getting otp from email or mobile number

Submitted by anonymous - 2 years ago