Regular Expressions 101

Fing GTM code in html

Open Workspace
  • PCRE2 (PHP)
  • Match
1

Regular Expression

/
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