R: [WSG] Javascript help with Reg Exp required please

2008-06-02 Thread lisa . kerrigan
Return Receipt Your R: [WSG] Javascript help with Reg Exp required please document

Re: [WSG] Javascript help with Reg Exp required please

2008-06-02 Thread E Michael Brandt
When you need the rule to be dynamic you do it this way to recompile the regular expression: var txt="foo"; myRe= new RegExp (txt+"\\s", "i"); myArray = myRe.exec("The Foo fooSz Fighers"); alert(myArray) Notice the \\. It just may be that your way would work with \\ in place of \. But tech

R: [WSG] Javascript help with Reg Exp required please

2008-06-02 Thread Dennis Lapcewich
Return Receipt Your R: [WSG] Javascript help with Reg Exp required please document

Re: [WSG] Javascript help with Reg Exp required please

2008-06-02 Thread Rimantas Liubertas
> var rule2 = eval('/' + txt + '\s/i'); > console.log(str2.match(rule2)); // returns fooSz Try var rule2 = eval('/' + txt + '\\s/i'); Regards, Rimantas -- http://rimantas.com/ *** List Guidelines: http://webstandardsgroup.org/mail

R: [WSG] Javascript help with Reg Exp required please

2008-06-02 Thread Diego La Monica
: lunedì 2 giugno 2008 19.44 A: wsg@webstandardsgroup.org Oggetto: [WSG] Javascript help with Reg Exp required please Good day all, Does anyone already get the following issue ? var str = "The Foo fooSz Fighers"; var rule = /foo\s/i; console.log(str.match(rule)); // r

[WSG] Javascript help with Reg Exp required please

2008-06-02 Thread Pierre-Henri Lavigne
Good day all, Does anyone already get the following issue ? var str = "The Foo fooSz Fighers"; var rule = /foo\s/i; console.log(str.match(rule)); // returns Foo var str2 = "The Foo fooSz Fighers"; var txt = "foo"; var rule2 = eval('/' + txt + '\s/i'); console.log(str2.match(rule2)); // retu