Method InviteRegex
- Namespace
- DisCatSharp.Common.RegularExpressions
- Assembly
- DisCatSharp.Common.dll
InviteRegex()
[GeneratedRegex("^((https?:\\/\\/)?(www\\.)?discord\\.gg(\\/.*)*|(https?:\\/\\/)?(www\\.|canary\\.|ptb\\.|staging\\.)?(discord|discordapp)(\\.com|\\.co)\\/invite)\\/(?<code>[a-zA-Z0-9]*)(\\?event=(?<event>\\d+))?$", RegexOptions.Compiled|RegexOptions.ECMAScript)]
public static Regex InviteRegex()
Returns
Remarks
Pattern:
^((https?:\\/\\/)?(www\\.)?discord\\.gg(\\/.*)*|(https?:\\/\\/)?(www\\.|canary\\.|ptb\\.|staging\\.)?(discord|discordapp)(\\.com|\\.co)\\/invite)\\/(?<code>[a-zA-Z0-9]*)(\\?event=(?<event>\\d+))?$Options:<br />
<pre><code class="lang-csharp">RegexOptions.Compiled | RegexOptions.ECMAScript</code></pre><br />
Explanation:<br />
<pre><code class="lang-csharp">○ Match if at the beginning of the string.
○ 1st capture group. ○ Match with 2 alternative expressions. ○ Match a sequence of expressions. ○ Optional (greedy). ○ 2nd capture group. ○ Match the string "http". ○ Match 's' atomically, optionally. ○ Match the string "://". ○ Optional (greedy). ○ 3rd capture group. ○ Match the string "www.". ○ Match the string "discord.gg". ○ Loop greedily any number of times. ○ 4th capture group. ○ Match '/'. ○ Match a character other than '\n' greedily any number of times. ○ Match a sequence of expressions. ○ Optional (greedy). ○ 5th capture group. ○ Match the string "http". ○ Match 's' atomically, optionally. ○ Match the string "://". ○ Optional (greedy). ○ 6th capture group. ○ Match with 4 alternative expressions. ○ Match the string "www.". ○ Match the string "canary.". ○ Match the string "ptb.". ○ Match the string "staging.". ○ 7th capture group. ○ Match the string "discord". ○ Match with 2 alternative expressions. ○ Match an empty string. ○ Match the string "app". ○ 8th capture group. ○ Match the string ".co". ○ Match with 2 alternative expressions. ○ Match 'm'. ○ Match an empty string. ○ Match the string "/invite". ○ Match '/'. ○ "code" capture group. ○ Match a character in the set [0-9A-Za-z] greedily any number of times. ○ Optional (greedy). ○ 9th capture group. ○ Match the string "?event=". ○ "event" capture group. ○ Match a character in the set [0-9] greedily at least once. ○ Match if at the end of the string or if before an ending newline.