Help with regex expression ?

44 views
Skip to first unread message

Tony K

unread,
Apr 26, 2020, 5:48:18 AM4/26/20
to TiddlyWiki
Hello

I am trying to do a regex that would extract the youtube video ID from a URL


/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/
however it is not working in Tiddly 

{{{ [[https://www.youtube.com/watch?v=OcLbZFS4Ge8&t=68s]splitregexp[/^.*((youtube.com/]] }}}

anyone can assist?

thank you 


Mohammad

unread,
Apr 26, 2020, 6:30:18 AM4/26/20
to TiddlyWiki
This is a booklet on using Regexp in Tiddlywiki

Tony K

unread,
Apr 26, 2020, 7:57:56 AM4/26/20
to TiddlyWiki
Thanks Mohammad

but I still don't get why the regex i found doesn't work :( 
is it a non-standard format/?

Mark S.

unread,
Apr 26, 2020, 9:13:35 AM4/26/20
to TiddlyWiki
There was an error in your expression. It might help to explain what it is you want to do. This will work, but I don't know if it is what you want:

Reply all
Reply to author
Forward
0 new messages