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 780857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:08:26+00:00 2026-05-14T20:08:26+00:00

I need to grab the video ID from a Google Video URL. There are

  • 0

I need to grab the video ID from a Google Video URL. There are two different types of URLs that I need to be able to match:

http://video.google.com/videoplay?docid=-3498228245415745977#

where I need to be able to match -3498228245415745977 (note the dash; -), and

video.google.com/videoplay?docid=-3498228245415745977#docid=2728972720932273543

where I need to match 2728972720932273543. Is there any good regular expression that can match this?

This is what I’ve got so far: @"docid=(-?\d{19}+)" since the video ID seems to be 19 characters except when it’s prefixed with the dash.

I’m using C# (of which I have very little experience) if that changes anything.

P.s. I would also appreciate you review my regular expressions for YouTube (@"[\?&]v=([^&#])";), RedTube (@"/(\d{1,6})") and Vimeo (@"/(\d*)").

I do not expect users to enter the full URL and thus do not match the ^http://\\.?sitename+\\.\\w{2,3}.

  • 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-14T20:08:27+00:00Added an answer on May 14, 2026 at 8:08 pm

    The following piece of RegEx uses what is called negative lookahead to make sure that there is not any part of the string after the match that contains #docid:

    docid=(-?\d{19}(?!\#docid=))
    

    the (?!\#docid=) is the negative lookahead part of the RegEx. If you want to know more about it you could look at http://www.regular-expressions.info/lookaround.html

    Hope this helps you

    EDIT:
    If you haven’t already gotten it you should get “The Regulator 2.0” from sourceforge. Its an Design and testing tool for Regular Expressions. I find it very helpful when I develope regular expressions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to grab a column called SymNumber from two different tables. Both are
I've got a string of HTML that I need to grab the [Title| http://www.test.com]
I need grab the path of a referring URL, which can be served from
I need to grab the duration of a video file via python as part
I have a Windows Media Video file, and the need to grab a frame
i need grab to internet explorer address bar. how to get address bar url
i need grab to firefox address bar. how to get address bar url for
I need to grab some of my website's old URLs and do a 301
I need to grab all categories that don't have subcategories 1 ^--1.1 ^--1.2 ^--1.2.3
I need to grab all the FIELD and VALUES from a POST. I have

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.