Put regex into separate file

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-05-11 22:18:52 +05:30
parent 6f0362802a
commit 31740f4ec6
2 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,4 @@
const regex = /(?:https|http|ftp):\/\/[a-zA-Z0-9:.\[\]#-]+(?:[\/#][^\s]*[^\s.,?!]|[^\s\u{80}-\u{10ffff}.,?!])/gui import { regex } from "./regex.js";
export function linkify(text, callback) { export function linkify(text, callback) {
const matches = text.matchAll(regex); const matches = text.matchAll(regex);

View File

@ -0,0 +1 @@
export const regex = /(?:https|http|ftp):\/\/[a-zA-Z0-9:.\[\]#-]+(?:[\/#][^\s]*[^\s.,?!]|[^\s\u{80}-\u{10ffff}.,?!])/gui