The WP_Token_Map class in WordPress 6.6 efficiently answers the question: “Does this string at this offset contain one of a known set of tokens, and if it does, what is the replacement value for that token?”
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed