That's what I'm doing now as a workaround, but I need to run the regex anyway to see if the input matches the correct format. The perfectionist in me wants to extract the matches at the same time, and I want to know what's wrong with my regex, coz otherwise how will I learn? :D
-Josh On Fri, Oct 3, 2008 at 10:36 AM, Scott Melby <[EMAIL PROTECTED]> wrote: > 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 > > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." http://flex.joshmcdonald.info/ :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]