Like many, when I am faced with the creation of patterns in preg_match or regx, I go into a state of confusion. Those of you that are the experts come up with patterns that make sense once they have been created; it is creating it. Well, enough crying! Here is my challenge:
I have tags in a HTML file that have this structure
$tag1 = '<!--[NewsletterDate-start]-->';
$tag2 = '<!--[NewsletterDate-end]-->';
$tag1 = '<!--[Thought-start]-->';
$tag2 = '<!--[Thought-end]-->';
I would like to create an array of all occurrences that have "-start" with just the text between "[..]". The structure of the tags has not been set in stone at this time, so maybe a change would make the pattern easier.
Can a pattern be created that would put into the $match array "NewsletterDate-start" and "Thought-start" or "NewsletterDate" and "Thought"?
Over whelmed...
Todd