What's the problem with regex?
There is this expression
search for YouTube id follows the link of the picture. I make the expression look for the standard link
like this -
but it doesn't work. Where is the mistake
In the code, you get the video__media element, assign it to the media variable, and then write
let url = media.src;. Apparently, this is an ifram, and here is an error, you need to get the value in src like this:
let url = media.getAttribute ('src');should workAnonymous
You have escaped the opening parenthesis and it has changed from a service symbol for the beginning of a group into a regular expression symbol.Anonymous
To place the code, please use CodePen or similar tool. Thanks you!