Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 702487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:43:36+00:00 2026-05-14T03:43:36+00:00

I need a regexp help, because for me it will take a lot of

  • 0

I need a regexp help, because for me it will take a lot of time , for you some minutes:)

I have youtube a URL :

http://www.youtube.com/watch?v=9_Hd8hXhg7o&feature=youtube_gdata 

I can’t add this in embed object , for embed I have to change in this URL :

http://www.youtube.com/v/9_Hd8hXhg7o&hl=en_US&fs=1&

It means, that I want to add the youtube cod in some variable, something like this

var url = after regexp "9_Hd8hXhg7o";

"http://www.youtube.com/v/" + url +"&hl=en_US&fs=1&";

thanks !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:43:36+00:00Added an answer on May 14, 2026 at 3:43 am

    This should do it:

    var url = "http://www.youtube.com/watch?v=9_Hd8hXhg7o&feature=youtube_gdata";
    
    var id = url.match(/(\?|&)v=(.*?)(&|$)/)[2];
    
    var new_url = "http://www.youtube.com/v/" + id+"&hl=en_US&fs=1&";
    

    This should work on pretty much every format you throw at it. This snippet looks for ?v= or &v= and any characters after that until an & symbol or end of line, so the ID can be found from these also:

    http://www.youtube.com/watch?v=9_Hd8hXhg7o
    http://www.youtube.com/watch?feature=youtube_gdata&v=9_Hd8hXhg7o
    http://www.youtube.com/watch?fs=1&v=9_Hd8hXhg7o&feature=youtube_gdata&
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help about RegExp in AS3. I have a simple pattern :
I need some help writing a regex. I have the following strings, xxx.yyy.wwwwwaaa_IN_123 xxx.rrrttttt_IN_12355
I need help with some Regexp Javascript/JQuery. I got it working, but I think
I need help writing regular experssion that will match phone numbers in some data.
I need help on regex or preg_match because I am not that experienced yet
I need some help using regex in java. Im trying to achieve 2 different
I need some help. I am looking for a regex that would match the
Hay guys, i need help with a REGEX. I have the got the value
Once again, I need some help and I appreciate you all for being here
I need some help trying to figure out how to format dates in perl.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.