Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
hi,
I am trying to extract youtube vide id from a text file using regular expression. could anyone please help me with regular expression. following is the sample text from which I need to extract the video id.

HTML
<a href="/watch?v=9eKbJJ1I1Jg&list=PLE73ACAC7B7772367&index=1" title="Company of Heroes 2 - Main Theme by Cris Velasco">
        <span class="title video-title">Company of Heroes 2 - Main Theme by Cris Velasco</span>
</a>

<a href="/watch?v=LY0FvYWz1sw&list=PLE73ACAC7B7772367&index=2" title="Ace Combat 6 - The Liberation of Gracemeria by Keiki Kobayashi">
              <span class="title video-title">Ace Combat 6 - The Liberation of Gracemeria by Keiki Kobayashi</span>
Posted
Updated 1-Aug-13 11:47am
v2
Comments
Sergey Alexandrovich Kryukov 1-Aug-13 18:27pm    
Are you trying to download Youtube video this way? If so, video id won't help you anymore...
—SA
mryeti 2-Aug-13 1:29am    
no. I need it for my library software.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900