mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-04 04:25:39 +00:00
⚡ export regex
This commit is contained in:
3
src/util/Regex.ts
Normal file
3
src/util/Regex.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export const DOUBLE_WHITE_SPACE = /\s\s+/g;
|
||||
export const SPECIAL_CHAR = /[@#`:\r\n\t\f\v\p{C}]/gu;
|
||||
export const CHANNEL_MENTION = /<#(\d+)>/g;
|
||||
@@ -1,5 +1,4 @@
|
||||
export const DOUBLE_WHITE_SPACE = /\s\s+/g;
|
||||
export const SPECIAL_CHAR = /[@#`:\r\n\t\f\v\p{C}]/gu;
|
||||
import { DOUBLE_WHITE_SPACE, SPECIAL_CHAR } from "./Regex";
|
||||
|
||||
export function trimSpecial(str: string) {
|
||||
return str.replace(SPECIAL_CHAR, "").replace(DOUBLE_WHITE_SPACE, " ").trim();
|
||||
|
||||
Reference in New Issue
Block a user