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

  • SEARCH
  • Home
  • 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 8263143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:00:07+00:00 2026-06-08T04:00:07+00:00

Here is an example of url structure I’ll be working with (ignore the age

  • 0

Here is an example of url structure I’ll be working with (ignore the age of electric video 🙂 )

http://www.youtube.com/embed/ABCumLrphFA?&start=20&end=50

Basically I want to be able to grab the video id, the chosen start time (20) and end chosen time (50) and save them as variables from any URL that follows the pattern above.

So a simple setup is this:

var url = 'http://www.youtube.com/embed/ABCumLrphFA?&start=20&end=50'

// get youtube id
function youtubeid(url) {
    var ytid = url.match(dont know);
    ytid = ytid[1];
    return ytid;
}
// get youtube start time
function youtubeStart(url) {
    var ytStart = url.match(dont know);
    ytStart=ytStart[1];
    return ytStart;
}
// get youtube end time
function youtubeEnd(url) {
    var ytEnd = url.match(dont know);
    ytEnd=ytEnd[1];
    return ytEnd;
}

If you could help me fill in the blanks that would be most amazing. I’ve been staring at regex documentation for a while now and just getting more and more confused.

  • 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-06-08T04:00:12+00:00Added an answer on June 8, 2026 at 4:00 am

    This other Stack Overflow answer may help you. I used Peter Mortensen’s answer below.

    • Get query string values in JavaScript

    To obtain the actual YouTube Id, you can use this regular expression:

    http:\/\/www.youtube.com\/embed\/(.{11})
    

    That regex will return the value in parenthesis. You can test it here:

    • http://www.pagecolumn.com/tool/regtest.htm

    Sample code:

    var url = 'http://www.youtube.com/embed/ABCumLrphFA?&start=20&end=50'
    
    // get youtube id
    function youtubeid(url) {
        var ytid = url.match(/http:\/\/www.youtube.com\/embed\/(.{11})/);
        ytid = ytid[1];
        return ytid;
    }
    alert(youtubeid(url));
    
    function getParameterByName(name, url) {
        var match = RegExp('[?&]' + name + '=([^&]*)')
                        .exec(url);
        return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
    }
    
    alert(getParameterByName('start', url));
    alert(getParameterByName('end', url));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get a url structure like this. http://example.com/blog/1/title-name-goes-here My main urls
With the URL Structure like http://www.site.com/user/1 , is it a security risk? For example
Here's what I'm trying to achieve: Before: www.example.com/index.php?page=about&pg=5 After: www.example.com/about.html?pg=5 The URL must specifically
I have a web page with basicly the following URL structure: www.example.com/main.php?userId=mattias.wolff www.example.com/definitions.php?userId=mattias.wolff www.example.com/tasks.php?userId=mattias.wolff
I am working with a CSV that has the following structure: 2012-09-01 20:03:15,http://example.com The
Here's an example taken from http://docs.jquery.com/API/1.1/AJAX#.24.post.28_url.2C_params.2C_callback_.29 $.ajax({ type: POST, url: some.php, data: name=John&location=Boston, success:
Example here: http://jezebel.com/5896408/racist-hunger-games-fans-dont-care-how-much-money-the-movie-made Click on the 3x3 Tweets screencap they have up. I love
I just did a redesign for www.wildchildclothes.com which has a new URL structure. The
For example Input <url wiki=https://wiki.archlinux.org/index.php/Main_Page forums=https://bbs.archlinux.org/> Desired output <url wiki=https://wiki.archlinux.org/index.php/Main_Page forums=https://bbs.archlinux.org/> Here's a sample
Here an example http://jsfiddle.net/EhLsT/ $(window).scroll(function () { if ($(window).scrollTop() > $(#header).offset().top) { $(#floating).show(); }

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.