Table of Contents
API reference

Method AdvancedYoutubeRegex

Namespace
DisCatSharp.Common.RegularExpressions
Assembly
DisCatSharp.Common.dll

AdvancedYoutubeRegex()

[GeneratedRegex("http(s)?:\\/\\/(www\\.)?youtu(\\.be|be\\.com)\\/(watch\\?v=|playlist)?(?<id>\\w{1,})?((\\?|\\&)list=(?<list>[\\w-_]{1,}))(&index=(?<index>\\d{1,}))?", RegexOptions.Compiled|RegexOptions.ECMAScript)]
public static Regex AdvancedYoutubeRegex()

Returns

Regex

Remarks

Pattern:

http(s)?:\\/\\/(www\\.)?youtu(\\.be|be\\.com)\\/(watch\\?v=|playlist)?(?<id>\\w{1,})?((\\?|\\&)list=(?<list>[\\w-_]{1,}))(&index=(?<index>\\d{1,}))?

Options:<br />
<pre><code class="lang-csharp">RegexOptions.Compiled | RegexOptions.ECMAScript</code></pre><br />
Explanation:<br />
<pre><code class="lang-csharp">○ Match the string "http".

○ Optional (greedy). ○ 1st capture group. ○ Match 's'. ○ Match the string "://". ○ Optional (greedy). ○ 2nd capture group. ○ Match the string "www.". ○ Match the string "youtu". ○ 3rd capture group. ○ Match with 2 alternative expressions. ○ Match the string ".be". ○ Match the string "be.com". ○ Match '/'. ○ Optional (greedy). ○ 4th capture group. ○ Match with 2 alternative expressions. ○ Match the string "watch?v=". ○ Match the string "playlist". ○ Optional (greedy). ○ "id" capture group. ○ Match a word character (ECMA) greedily at least once. ○ 5th capture group. ○ 6th capture group. ○ Match a character in the set [&?]. ○ Match the string "list=". ○ "list" capture group. ○ Match a character in the set [-0-9A-Z_a-z\u0130] greedily at least once. ○ Optional (greedy). ○ 7th capture group. ○ Match the string "&index=". ○ "index" capture group. ○ Match a character in the set [0-9] atomically at least once.