I have the string src="//www.youtube.com/embed/9w6YSZ_o7rA"
where the URL could be anything, and I want to add ?autoplay=1
at the end, so I'll have:
src="//www.youtube.com/embed/9w6YSZ_o7rA?autoplay=1"
Could someone recommend a clean regex expression to use with JavaScript str.replace()?
This doesn't require regex.
edit: updated to account for possible fragment (though It's n/a for youtube urls)