Regex on substrings

2011-06-02 Thread Peter van der Zee
A problem I faced recently is the inability to apply regular expressions to a substring of a string without explicitly taking the substring first. So I'm wondering how much trouble it would be to extend the RegExp api to this... RegExp.prototype.test = function(string[, start=0[,

RE: Regex on substrings

2011-06-02 Thread Dave Fugate
Sent: Thursday, June 02, 2011 4:30 AM To: es-discuss Subject: Regex on substrings A problem I faced recently is the inability to apply regular expressions to a substring of a string without explicitly taking the substring first. So I'm wondering how much trouble it would be to extend the RegExp

Re: Regex on substrings

2011-06-02 Thread Mike Samuel
2011/6/2 Peter van der Zee e...@qfox.nl: A problem I faced recently is the inability to apply regular expressions to a substring of a string without explicitly taking the substring first. So I'm wondering how much trouble it would be to extend the RegExp api to this... RegExp.prototype.test

Re: Regex on substrings

2011-06-02 Thread Peter van der Zee
On Thu, Jun 2, 2011 at 7:17 PM, Mike Samuel mikesam...@gmail.com wrote: 2011/6/2 Peter van der Zee e...@qfox.nl: A problem I faced recently is the inability to apply regular expressions to a substring of a string without explicitly taking the substring first. So I'm wondering how much trouble

Re: Regex on substrings

2011-06-02 Thread Brendan Eich
Note that http://wiki.ecmascript.org/doku.php?id=harmony:regexp_y_flag has been promoted to harmony:proposals status (see http://wiki.ecmascript.org/doku.php?id=harmony:proposals), so very likely to be in ES.next. With this flag on a regexp, you don't need extra arguments for a suite of