I am try to develop a regular expression to match multiple instances that look like the following:
Instance 1: {--command--}
Instance 2: {--command value="argument"--}
Instance 3: {--command value="argument1" value="argument2" ... value="argumentN"--}
I wish to capture the command, and any arguments associated with it. Multiple instance of any of the above patterns may be found within the text I'm searching.
So far, I have put together the following pattern:
\{--([a-zA-Z0-9_-]*?)( [Vv][Aa][Ll][Uu][Ee]="(.*?
)")*--\}
It handles the the first and second instances without any apparent trouble; however, it refuses to match multiple value="argument" pairs and will only match the last pair in the list.
For all of you Regex gurus out there -- any ideas?