In comp.lang.javascript message <f098dbac-c1f4-4abb-a982-2b610a5f863c@d2
1g2000prf.googlegroups.com>, Tue, 11 Dec 2007 11:01:57, simplicity
<> posted:
>
>My question is how can I use current value of searchString as part of
>regular expression /.../g? I tried
>"/" + searchString + "/g" with no effect.
var RE = new RegExp(S1 + searchString + S2, S3) // S1 S2 S3 strings.
Seek "A literal text format or the RE constructor function." after
replacing RE by RegExp (changed to prevent that seek finding, in
perpetuity, this article).
It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
|