2010-09-18, 09:06 AM
(This post was last modified: 2010-09-18, 09:07 AM by tacticalbread.)
I'm trying to do a MyCode version of HTML5's audio tag, and I've got it working just fine like this:
replacing
and I was trying to get something like this working:
replacing
I got that working as long as I typed:
Which brings me to my question, how can I do it to where I type something like this:
and have it still work?
In short, how do I have optional tags in a MyCode tag?
\[audio\](.*?)\[/audio\]
replacing
<audio controls="controls" src="$1">Your browser does not support this, blah blah blah.</audio>
and I was trying to get something like this working:
\[audio\ ogg=(.*?) mp3=(.*?) wav=(.*?)](.*?)\[/audio\]
replacing
<audio controls="controls">
<source src="$1" type="audio/ogg" />
<source src="$2" type="audio/mpeg" />
<source src="$3" type="audio/wav" />
$4</audio>
I got that working as long as I typed:
[audio ogg="link to ogg" mp3="" wav=""]blah[/audio]
Which brings me to my question, how can I do it to where I type something like this:
[audio ogg="link to ogg"]blah[/audio]
or
[audio mp3="link to mp3"]blah[/audio]
and have it still work?
In short, how do I have optional tags in a MyCode tag?