Josh -
Maybe I am mis-understanding what you want to do... but, the following code
var startStr:String ="objectA.objectB.objectC";
var afterSplit:Array = startStr.split(".");
results in
afterSplit[0] == "objectA";
afterSplit[1] == "objectB";
afterSplit[2] == "objectC";
Can you just split the String?
hth
Scott
Josh McDonald wrote:
> Hey guys,
>
> I'm trying to turn this "objectA.objectB.objectC" into ["objectA",
> "objectB", "objectC"] using a regex, but all I seem to get using
> String.match() is ["objectA", "objectC"]. Can anybody tell me what's wrong
> with the following?
>
> const multiLevelReferencePattern : RegExp =
> /([a-zA-Z0-9_]+)(?:\.([a-zA-Z0-9_]+))+/;
>
> I also tried to match into ["objectA", ".objectB", ".objectC"] by throwing
> out the non-matching group and rolling the "\." into the last matching
> group, but I still get the same result (only the last match comes through).
>
> For now I've switched to a simpler regex in order to RegExp.test() the
> string and then using String.explode(), but I would like to do both at once
> using String.match() if possible.
>
> Cheers,
> -Josh
>
>
--
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com