On Fri, Nov 28, 2008 at 7:59 AM, markgoldin_2000
<[EMAIL PROTECTED]> wrote:
> var pattern:RegExp = /resultXML.toString().substr(1, 22)/g;

> [...] No changes is shown in resultXML. What am I doing wrong?

If you're going to interpolate into your RegExp source you shouldn't be using
literal notiation.

Try this out so you understand what I mean:

var patternA:RegExp = /resultXML.toString().substr(1, 22)/g;
var patternB:RegExp = new RegExp(resultXML.toString().substr(1, 22), "g");

trace("patternA.source", patternA.source);
trace("patternB.source", patternB.source);

On yours you're not getting the string representation of your XML into the
regexp search pattern, but your actually asking it to find an "r" followed by
an "e" followed by an "s", "u", "l", "t", etc.

hope this helps,
gabriel.


-- 
gabriel montagné láscaris comneno
http://rojored.com
t/506.8367.6794

Reply via email to