Regular Expressions 101

Community Patterns

regex101.com permalink id grabber

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 - 10 years ago (Last modified 2 days ago)