Regular Expressions 101

Community Library Entry

483

Regular Expression
PCRE (PHP <7.3)

/
^https?:\/{2}regex101\.com\/r\/([a-zA-Z0-9]{6})(?:\/(\d+)?)
/
gm

Description

Grabs the ID for the regex101.com permalink code. If a revision number is provided, grab that as well.

Submitted by chris mccoy - 11 years ago (Last modified 7 months ago)