Thanks Jon.

That was the ticket. I slightly modified it, but it's still the basic
stuff.


On Jan 23, 3:33 pm, Jonathan Street <[email protected]> wrote:
> I think you're over-complicating the problem in trying to construct a regex
> that does everything.  I suspect it would be easier to search for
> \[mediaspace(.+?)\] and then use explode on space to separate out each of
> the attribute=value pairs and then explode again on = to separate attribute
> from value.
>
> On 23 January 2011 18:27, theprodigy <[email protected]> wrote:
>
>
>
>
>
>
>
> > forgot to add src to the list of attributes I would like to accept.
> > Here is the updated list:
>
> > width:500,
> > height:400,
> > src:whatever.flv (or myimage.jpg, etc),
> > autoplay: false,
> > fit:false,
> > title:false,
> > closetitle:false,
> > firstitem:true
>
> > I think I have a good start on it. Here is what I have.
> > (\[mediaspace)(\s+(width|height|src|autoplay|fit|title|closetitle|
> > firstitem)=(\d|\w|\.)+)+\]
>
> > That has a few problems I would like to avoid if possible. It allows
> > multiple of the same attribute being set:
> > [mediaspace width=200 width=375]
>
> > And it also allows the attributes to be set with either numbers,
> > letters, or . (the period - I added due to src attribute needing file
> > extension)
>
> > If possible, I would like each attribute being able to be set only
> > once (or not at all - defaults will be used), and the following
> > settings:
>
> > width (numeric)
> > height (numeric)
> > src (normal file settings with extension)
> > autoplay (boolean)
> > fit (boolean)
> > title (boolean)
> > closetitle (boolean)
> > firstitem (boolean)
>
> > The following regex restricts what each can be set to, and allows to
> > put them in any order, but doesn't restrict one per.
>
> > (\[mediaspace)(\s+(width=(\d)+|height=(\d)+|src=(\d|\w|\.)+|
> > autoplay=(true|false)|fit=(true|false)|title=(true|false)|
> > closetitle=(true|false)|firstitem=(true|false))?)*\]
>
> > I thought the ? would restrict 0 or 1, but I guess not in this case.
>
> > I would appreciate any help you can offer.
>
> > Thanks
>
> > --
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/habari-dev

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev

Reply via email to