Subj : Re: string declaration without evaluation To : netscape.public.mozilla.jseng From : Sterling Bates Date : Wed Jun 02 2004 10:52 am Moe tokrot wrote: > const char my_string[]="var src=\"text \""; > > JS_EvaluateScript(cx,obj,my_string,strlen(my_string), filename, lineto, > &rval); > > My goal is to analyse src (not evaluated...the string exactly as above ) > with a regexp: You could create a new JSString based on my_string, then declare it as a property of the global object, and finally do your reg exp on the declared variable. Sort of like this: jsval rval; JSString *str = JS_NewString(cx, my_string); JS_DefineProperty(cx, global, "src", STRING_TO_JSVAL(str), nil, nil, 0); JS_Evaluate(cx, my_string2, strlen(my_string2), "", 0, &rval); Sterling .