On 4/14/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
>
>
> Timothy Johnson wrote:
> > Will the string always have the two quotes in the same place and only
> > one per string?  What about something like this?
> >
> > /.*?\{([^\}]*)\}(?=.*")/gi
>
> I tested it out and it appears to be perect! Thank Mr. Johnson :)
>
> I love when I learn a new tidbit!

A couple of things here.

* You're not matching anything alphabetic here, so the "i" modifier is
superfluous.
* Using "^" in a class to limit a search is usually less efficient
than doing a 'non-greedy" search.
* Curly braces aren't metacharacters. they only need to be escaped
when they could be mistaken for range delimiters.

If you're going through a few thousand iterations, you'll be happier
with something like:

   /.*?{(\.*?)}(?=.*")/go

HTH,

-- jay
--------------------------------------------------
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.dpguru.com  http://www.engatiki.org

values of β will give rise to dom!

Reply via email to