0

All I need comes from

var str = document.getElementById("content").innerHTML;

I need do do this:

var res = str.match(/stuff_I_want - stuff_I_dont_want + final_stuff_I_want/);

I did this

var res = str.match(/=http.*?.flv/gi);

But there are a lot of things in between that I don't want. The result is:

https://http/thing.com/file.php/1/cursos/sdsdsd/sdsdsdsd/videos/video-eap-3_ertyo.srt&
captions.fontsize=10&
captions.state=true&
file=https://dfdfdfdf.com/file.php/1/edcfr/videos/video-eap-3.flv

I would like to say I've opened another topic before this, but I thing people didn't understand me.

Tks everyone!

Webill
  • 365
  • 3
  • 12
  • 1
    I'm sorry to have to say I don't understand this question either. Can you give some test cases of the strings which should match or not ? – Denys Séguret Aug 11 '14 at 19:45
  • what is expected output? – Braj Aug 11 '14 at 19:45
  • what is the content ? – Kevin Labécot Aug 11 '14 at 19:47
  • You should give us: an example of the full input; an example of the full output; a better explanation of what is the final stuff you want. – djjeck Aug 11 '14 at 19:47
  • @djjeck See his [previous question](http://stackoverflow.com/questions/25212481/get-the-full-path-of-all-files-of-some-types-from-a-html-file-and-put-them-into) – Blazemonger Aug 11 '14 at 19:48
  • This content is in a html file. I want to retrieve some paths and deliver them into an array like this: – Webill Aug 11 '14 at 19:50
  • Array[0]=https://directory_W/videos/video-eap-3.flv Array[1]=https://directory_X/videos/video-eap-3.srt Array[2]=https://directory_Y/videos/video-eap-3.mp3 – Webill Aug 11 '14 at 19:52
  • You need to be more specific on the URL structure..I think this is what you want (now this only allows for `a-z`, `-`, `/`, and `.` in URLs): [`/https?:\/\/[a-z\-\/.]+?\.(flv|mp3|srt)/`](http://regex101.com/r/vO7bY4/1) – Sam Aug 11 '14 at 19:54
  • i would find the url, then use a parser on the url to extract the unencoded params – dandavis Aug 11 '14 at 20:11
  • Tks everyone. I have got my answer. – Webill Aug 11 '14 at 20:12

0 Answers0