Regular Expressions 101

Community Patterns

Matches the prefix at the beginning of string or after a slash

0

Regular Expression
Python

r"
.*(?:(?<=\/)|^)([a|g|amp|gmp]\d+)[\.]?(?:[\w-]+)?.*
"
gm

Description

Regex for extracting display_id from the URL

Submitted by anonymous - 5 years ago