Right. That’s why I was suggesting wrapping the call in a try/catch and 
returning null/-1 from the catch.

Additionally, the array returned from String.match() is a non-standard one. It 
has input and index properties.

> On Jul 20, 2017, at 8:52 PM, yishayw <yishayj...@hotmail.com> wrote:
> 
> I think there would still be a difference between flash and js because the
> flash implementation (counter to AS3 documentation) always returns null when
> an invalid regex is passed as a string. So according to your suggested
> implementation for
> 
> Var s: String = "m?o";
> Var a:Array = s.match("?")
> 
> a  is null in flash but ["?"] in JS.
> 
> 
> 
> --
> View this message in context: 
> http://apache-flex-development.2333347.n4.nabble.com/FlexJS-String-match-tp63392p63467.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply via email to