1
<video id="video" class="playerVideo" autoplay="1" x-webkit-airplay="allow" src="**matchme.mp4**" type="video/mp4">

This is what I have so far:

(?<=<video[^<>]+src=")/w*(?<!"[^<>]/video>)

I think my problems are stemming from not being able to use repetition within a lookaround. Just to be clear, i want to match the value inside the src attribute of a video tag,not including the attribute itself (src="matchme").

Community
  • 1
  • 1
Francisco Aguilera
  • 3,099
  • 6
  • 31
  • 57

2 Answers2

2

Try this pattern:

(?:<video[^>]+src=\")(?<src>[^"]+)

the capturing group is "src"

Working examples in:

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Bambuk
  • 192
  • 1
  • 15
2

I think this is a better solution, because it works with PCRE, JS, and Python.

<video[^>]+src=\"([^"]+)

However, I could not get it to work with Sublime Text 3. Finally, this worked with sublime:

<video[^>]+src=\"\K[^"]+

The \K assertion tells the engine to drop what was matched so far from the final match it returns.

Community
  • 1
  • 1
Francisco Aguilera
  • 3,099
  • 6
  • 31
  • 57