Method MessageLinkRegex
- Namespace
- DisCatSharp.Common.RegularExpressions
- Assembly
- DisCatSharp.Common.dll
MessageLinkRegex()
[GeneratedRegex("^(https?:\\/\\/)?(www\\.|canary\\.|ptb\\.|staging\\.)?(discord|discordapp)(\\.com|\\.co)\\/channels\\/(?<guild>(?:\\d+|@me))\\/(?<channel>\\d+)\\/(?<message>\\d+)\\/?", RegexOptions.Compiled|RegexOptions.ECMAScript)]
public static Regex MessageLinkRegex()
Returns
Remarks
Pattern:
^(https?:\\/\\/)?(www\\.|canary\\.|ptb\\.|staging\\.)?(discord|discordapp)(\\.com|\\.co)\\/channels\\/(?<guild>(?:\\d+|@me))\\/(?<channel>\\d+)\\/(?<message>\\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.
○ Optional (greedy). ○ 1st capture group. ○ Match the string "http". ○ Match 's' atomically, optionally. ○ Match the string "://". ○ Optional (greedy). ○ 2nd capture group. ○ Match with 4 alternative expressions. ○ Match the string "www.". ○ Match the string "canary.". ○ Match the string "ptb.". ○ Match the string "staging.". ○ 3rd capture group. ○ Match the string "discord". ○ Match with 2 alternative expressions. ○ Match an empty string. ○ Match the string "app". ○ 4th capture group. ○ Match the string ".co". ○ Match with 2 alternative expressions. ○ Match 'm'. ○ Match an empty string. ○ Match the string "/channels/". ○ "guild" capture group. ○ Match with 2 alternative expressions. ○ Match a character in the set [0-9] atomically at least once. ○ Match the string "@me". ○ Match '/'. ○ "channel" capture group. ○ Match a character in the set [0-9] atomically at least once. ○ Match '/'. ○ "message" capture group. ○ Match a character in the set [0-9] atomically at least once. ○ Match '/' atomically, optionally.