0

I have regex that not getting desired results:

(.*)"title":"(.+?)"(.*)"stream_url":"(.+?)"(.*)*

How to build above values regex from:

{"id":"334","title":"Al Kahera Wal Nas","catchup":false,"description":"","epg_channel_id":"196","genre_id":"20","pin_required":false,"trial":true,"server_id":"8","genre":"EGYPT","logo":"https://s3-eu-west-1.amazonaws.com/static.prod/storage/26/content/56440c5f-8504-4d85-bcf8-5984ac1f2e8b-AlKaheraWalNas.jpg","stream_url":"http:\/\/lv001.cdn03.greek.zaaptv.com:80\/live\/m3u8\/Alkahera.m3u8?__token__=ip=182.186.64.249~exp=1470381422~acl=\/live\/m3u8\/Alkahera.m3u8*~hmac=7d1cabf155247a1c3e3ce03d19dcdeeea484bb86f35680d9ebf27573d114dd90","stream_m3u8_url":"http://lv001.cdn03.greek.zaaptv.com:80/live/m3u8/Alkahera.m3u8?token=ip=182.186.64.249~exp=1470381422~acl=/live/m3u8/Alkahera.m3u8*~hmac=7d1cabf155247a1c3e3ce03d19dcdeeea484bb86f35680d9ebf27573d114dd90","dvr_url":""}},{"channel":{"id":"380","title":"Al Kahera Wal Nas +2","catchup":false,"description":"","epg_channel_id":"197","genre_id":"20","pin_required":false,"trial":true,"server_id":"8","genre":"EGYPT","logo":"https://s3-eu-west-1.amazonaws.com/static.prod/storage/26/content/564e6db3-10bc-43ca-8e53-2ce9ac1f2e8b-AlKaheraWalNasplus2.jpg","stream_url":"http:\/\/lv001.cdn03.greek.zaaptv.com:80\/live\/m3u8\/Alkahera2.m3u8?__token__=ip=182.186.64.249~exp=1470381422~acl=\/live\/m3u8\/Alkahera2.m3u8*~hmac=b4f1d4406c973e8d5806ec88da56c035d912ec370ff84d9513a7f49218eacd06","stream_m3u8_url":"http://lv001.cdn03.greek.zaaptv.com:80/live/m3u8/Alkahera2.m3u8?token=ip=182.186.64.249~exp=1470381422~acl=/live/m3u8/Alkahera2.m3u8*~hmac=b4f1d4406c973e8d5806ec88da56c035d912ec370ff84d9513a7f49218eacd06","dvr_url":""}},

Muhammad Muazzam
  • 2,810
  • 6
  • 33
  • 62

2 Answers2

1

Does this work for you?

"title":"([^"]+?)"(.*?)|"stream_url":"([^"]+?)"

It is based upon the answer from baddger964 but modified to put | so that it will match each instance separately

xenodevil
  • 604
  • 7
  • 18
0

Try this one :

"title":"([^"]+?)"(.*?)"stream_url":"([^"]+?)"

with global flag :

/"title":"([^"]+?)"(.*?)"stream_url":"([^"]+?)"/g
baddger964
  • 1,199
  • 9
  • 18