javascript - Better RegEx to extract GoogleVideo ID from URL -


Hi!

I use the following regex with JS to remove that ID from 6321890784249785097

  url.replace (/ ^ [^ \ $] +. (. {19}). *, "$ 1");  

But I have only cut the last 19 digits from the tail. How do I bullet proof more? Maybe with an explanation that I can learn something?

It should work a bit better:

/^.* DocId = (\ d +) $ /

it matches all the characters with 'docId =', then after that you give all the points to the end of the URL.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -