Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
GTM-[A-Z0-9]+
/

Description

This function extracts the Google Tag Manager (GTM) key from a given input string. The GTM key typically follows the format "GTM-XXXXXX", where "XXXXXX" represents a unique identifier.

Submitted by kanapka94 - 7 months ago