/*!
 * @techmely/utils
 * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com>
 * MIT Licensed
 */


// src/regex.ts
var emailRegex = new RegExp(
  /^(([^\s"(),.:;<>@[\\\]]+(\.[^\s"(),.:;<>@[\\\]]+)*)|(".+"))@((\[(?:\d{1,3}\.){3}\d{1,3}])|(([\dA-Za-z-]+\.)+[A-Za-z]{2,}))$/
);
var isValidEmail = (email) => emailRegex.test(email);
var vietnamPhoneRegex = new RegExp(/^0(\d{9})$/);
var isValidVnPhone = (phone) => vietnamPhoneRegex.test(phone);
var urlRegex = /(((^https?:(?:\/\/)?)(?:[\w$&+,:;=-]+@)?[\d.A-Za-z-]+(?::\d+)?|(?:www.|[\w$&+,:;=-]+@)[\d.A-Za-z-]+)((?:\/[\w%+./~-]*)?\??[\w%&+.;=@-]*(?:#\w*)?)?)$/;
var isValidUrl = (path) => urlRegex.test(path);
var multilineCommentsRegex = /\/\*(.|[\r\n])*?\*\//gm;
var singlelineCommentsRegex = /\/\/.*/g;
var escapedSpaceCharactersRegex = /( |\\t|\\n|\\f|\\r)+/g;

export { emailRegex, escapedSpaceCharactersRegex, isValidEmail, isValidUrl, isValidVnPhone, multilineCommentsRegex, singlelineCommentsRegex, urlRegex, vietnamPhoneRegex };
