Preg_match string inside curly braces tags
问题 I'd like to grab a string between tags. My tags will be with curly braces. {myTag}Here is the string{/myTag} So far I have found #<\s*?$tagname\b[^>]*>(.*?)</$tagname\b[^>]*>#s This one matches tags with angle brackets <> . I couldn't figure out how to make it look for curly braces. Eventually I would like to parse whole page and grab all matches and build an array with strings. This is the code: function everything_in_tags($string, $tagname) { $pattern = "#<\s*?$tagname\b[^>]*>(.*?)</