2020-06-25 15:34:03 +00:00
|
|
|
module RegexHelper
|
|
|
|
# user https://rubular.com/ to quickly validate your regex
|
|
|
|
|
|
|
|
# the following regext needs atleast one character which should be
|
|
|
|
# valid unicode letter, unicode number, underscore, hyphen
|
|
|
|
# shouldn't start with a underscore or hyphen
|
|
|
|
UNICODE_CHARACTER_NUMBER_HYPHEN_UNDERSCORE = Regexp.new('\A[\p{L}\p{N}]+[\p{L}\p{N}_-]+\Z')
|
2021-06-29 09:02:57 +00:00
|
|
|
MENTION_REGEX = Regexp.new('\[(@[\w_. ]+)\]\(mention://(?:user|team)/\d+/(.*?)+\)')
|
2022-09-29 17:34:55 +00:00
|
|
|
|
2022-10-12 00:32:31 +00:00
|
|
|
TWILIO_CHANNEL_SMS_REGEX = Regexp.new('^\+\d{1,15}\z')
|
|
|
|
TWILIO_CHANNEL_WHATSAPP_REGEX = Regexp.new('^whatsapp:\+\d{1,15}\z')
|
2022-11-02 02:51:42 +00:00
|
|
|
WHATSAPP_CHANNEL_REGEX = Regexp.new('^\d{1,15}\z')
|
2020-06-25 15:34:03 +00:00
|
|
|
end
|