[Prototype-core] Re: RegExp#escape
I really dig this idea and would find it very useful 8) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: RegExp#escape
Hi Ken- On Jul 24, 2007, at 11:43 AM, Ken Snyder wrote: Just wanted to suggest a static method of the RegExp object as a possible addition to core. RegExp.escape = function(str) { return str.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }; Good idea. Ruby has this, too, and I've missed it in JavaScript. Could you submit a tested patch to trac? -sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: RegExp#escape
Sam Stephenson wrote: ... Good idea. Ruby has this, too, and I've missed it in JavaScript. Could you submit a tested patch to trac? -sam Patch with tests are posted. (http://dev.rubyonrails.org/ticket/9094) - ken --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---