On Fri, May 15, 2009 at 12:05 AM, kangax <[email protected]> wrote: > > On May 14, 8:24 pm, Gabriel Gilini <[email protected]> wrote: > > var classNamesRegex = new RegExp('\\b(' + classesArr.join('|') + ')\\b'); > // > > Generates /\b(foo|bar|foob)\b/ > > Please don't use boundaries to separate class values. I wonder who > came up with this silly idea and why it keeps circulating around.
> /\bfoo\b/ matches values such as "foo-bar" which is, of course, wrong. Hm, I didn't know that. Actually I have never used /b myself, I didn't even know they existed in JavaScript. I thought they would replace just fine the (^|\s) thing (which is what I usually use). Thanks for the advice. Gabriel Gilini www.usosim.com.br [email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. 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/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
