CodyKochmann
7/5/2016 - 3:23 PM

get video links in coffeescript

get video links in coffeescript

regex_findall = (regex, s) ->
    # str = 'I learned to play the Ukulele in Lebanon.'
    # regex = /le/gi
    result = undefined
    indices = []
    while result = regex.exec(s)
      if result.length > 0
        indices.push result[0]
    indices

get_video_links = (s) ->
    regex = /[A-Za-z0-9\.\/\:]{1,}\.mp4/g
    regex_findall(regex, s)