Regexp will save the world, one text document at a time.
var s:String = "some long \"text\" goes in here and a swf url
\"one/two/three.swf\" went in there";
var re:RegExp = new RegExp('"([^"]+.swf)"','i');
var m:Array = s.match(re);
trace(m[1]); // one/two/three.swf
Cheers,
Adam
----- Original Message -----
From: João
To: [email protected]
Sent: Wednesday, March 21, 2007 7:43 AM
Subject: [flexcoders] Using Flex to extract a phrase from a text file
I have one text file with about 100 lines of random text. Somewhere on
the file, there is an URL for a SWF. The url has the .swf word in it,
and it's between "'s . The format of the file can change over time,
and there is only one SWF file on the text file.
I need to find the best algorithm to extract the URL from the text
file. Any suggestions?
Thanks,
João Saleiro