Python regex convert youtube url to youtube video
问题 I'm making a regex so I can find youtube links (can be multiple) in a piece of HTML text posted by an user. Currently I'm using the following regex to change 'http://www.youtube.com/watch?v=-JyZLS2IhkQ' into displaying the corresponding youtube video: return re.compile('(http(s|):\/\/|)(www.|)youtube.(com|nl)\/watch\?v\=([a-zA-Z0-9-_=]+)').sub(tag, value) (where the variable 'tag' is a bit of html so the video works and 'value' a user post) Now this works.. until the url is like this: 'http:/