Title |
Test
Find
Extract movie "value" attr from PARAM tag (for Flash)
|
Expression |
(?<=<param(?=[^<>]*?name\s*=\s*\x22movie\x22)[^<>]*?value\s*=\s*\x22)[^<>]*?(?=\x22[^<>]*?>) |
Description |
This pattern will extract the "value" attribute of a PARAM tag where name="movie". I created it for extracting the URI of an Adobe Flash animation from some HTML, but of course it would work for more general purposes. Don't forget to turn on case insensitivity. Code tidied up with help from Sergei Z. in the forums. Here's an older version, without the nested lookarounds: (?<=<param\s[^>]*?name\s*?=\s*?\x22\s*?movie\s*?\x22[^>]*?value\s*?=\s*?\x22)[^>]*?(?=\x22[^>]*?>)|(?<=<param\s[^>]*?value\s*?=\s*?\x22)[^>]*?(?=\x22[^>]*?name\s*?=\s*?\x22\s*?movie\s*?\x22[^>]*?>) |
Matches |
In <param name="movie" value="somefilename.swf"> matches "somefilename.swf" |
Non-Matches |
Doesn't match the surrounding HTML, Doesn't match non-"movie" params, e.g. <param name="song" value="somefilename.mp3"> |
Author |
Rating:
Not yet rated.
Tim Denby
|
Source |
|
Your Rating |
|