A
A
Alexander N++2014-01-02 14:16:39
ActionScript
Alexander N++, 2014-01-02 14:16:39

HTML parsing. How to pull flashvars through regular expression?

Good afternoon
Tell me why preg always produces a zero result:

var page:String  = e.target.data;
      var result:Array = page.match(/flashvars=\"(.*?)\"/gi);
      trace('flashvars', result.length );

PS page gets the rules.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander N++, 2014-01-02
@sanchezzzhak

Here is the solution

var page =  e.target.data;
var finder:RegExp  = /name=\"flashvars\"\s+value=\"(?P<flashvars>.*)\"/gi
var result:Array = finder.exec(page);
trace('flashvars', result.flashvars );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question