Hi Ted,

Not an expert on flash, but i would suppose you need to escape your "?" in the regexp with something like "\?".

Otherwise you may end up with the result:

xxx xxx Yes.

Cheers,
:)

On 15/11/2010 17:26, Lehr, Theodore wrote:
Say you have the following string:

var s:String = "This is a test. Is this a test? Yes.";

I am trying:

var findAndReplace:RegExp = new RegExp("Is this a test?", "gi");
s=s.replace(findAndReplace,"xxx");

I would expect to get back:

This is a test. xxx Yes.

but there seem to be an issue with the ? - how would I handle a ? in this case?

Thanks!

Ted
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to