vendredi 31 juillet 2015

preg_match_all rtmp links and its titles

Hi all there I have this string:

All text has PHP_EOL at end of its line.
Some TITLE OF RTMP STREAM
rtmp://slww/best
Some simple text what not required to find
Another not required string line

Used this regex to get rtmp or http links but how can i find its titles?

preg_match_all("/(rtmp:+\S*)|(http:+\S*)/s", $input_lines, $output_array);

That rtmp or html regex works correctly but i need to capture titles of rtmp links too.

Have tried to add ^.*$^ followed by my rtmp http pattern , as ^ its start of line and $ its end of it. And /s option for search multiple lines including new line characters.

/^.*$^(rtmp:+\S*)|(http:+\S*)/s

But can not figure it out how can i find its title. Simple what i have tried to archive is to get whole line above my regex or below my regex.

In some cases i need to grab whole line below.

Any thoughts?

Aucun commentaire:

Enregistrer un commentaire