From 16eae7eafe9ef6001f664a30c0f78d6982d2e54c Mon Sep 17 00:00:00 2001 From: ckohen Date: Sat, 19 Jun 2021 11:15:10 -0700 Subject: [PATCH] feat(FormattingPatterns): add timestamp (#146) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Antonio Román Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- deno/globals.ts | 18 ++++++++++++++++++ globals.ts | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/deno/globals.ts b/deno/globals.ts index f433bea4..a01c0646 100644 --- a/deno/globals.ts +++ b/deno/globals.ts @@ -61,6 +61,24 @@ export const FormattingPatterns = { * The `name` and `id` group properties are present on the `exec` result of this expression */ StaticEmoji: /<:(?\w{2,32}):(?\d{17,20})>/, + /** + * Regular expression for matching a timestamp, either default or custom styled + * + * The `timestamp` and `style` group properties are present on the `exec` result of this expression + */ + Timestamp: /-?\d{1,13})(:(?