I'm having a problem with regular expressions. What I need to do is parse a text file with some of my own custom tags. For example, to insert an image, the tag would be:
<insert img="filename.jpg" title="title of image" artist="artist name" medium="image medium" caption="...">
the regular expression that I am using to match this text is:
$pattern = "/(<insert(?:\s+(?:img|title|artist|medium|caption)\s*=\s*\".\")*>)/x";
For some reason, if I omit the "*>" at the end of the expression and change the last "." to a "\w+" I can retrieve the <insert img="filename" but when I put in those values it finds nothing. Could someone please help me out? Thanks in advance.