Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
#\{(?![.\d])(?=(?<inner>(?:[\-_]{0,4}(?<![\-_]{5})[\p{L}\d]{2,}[\.\-_]?[\-_]{0,3})+))\1(?<!\.)\}
/
gu
Input 1
- Must start with `#{`, not captured. - Must end with `}`, not captured. - Named capture group 'inner' within the brackets. - Must only contain periods, dashes, underscores, unicode letters, and 0-9 digits. - Must contain at least two unicode letters, or at least one unicode letter and digit. - Cannot begin or end with a period. Ex.`#{.foo.}`not matched. - Cannot start with a digit. Ex. `#{42_digitAtStart}` is not matched. - No periods before unicode chars, Ex. `#{_.foo}` is not matched. - Two periods cannot be next to one another. Ex. `#{foo.bar}` is OK, but `#{foo..bar}`, `#{.foo}`, and `#{foo.}` are not. - cannot contain any mix of more than 4 dashes or underscores next to one another. Eg. `#{foo____}` and `#{-_-_foo-bar_-_-}` are OK, but `#{--___ foo}` and `#{bar-_-_--} are not. MUST MATCH #{alpha} #{beta} #{charlie} #{ìñtérnâtiônàlizàtïon} #{مرحبا} #{こんにちは} #{мир} #{-dashes-} #{_under_scores_} #{dots.and-dashes-and_under_scores} #{some_ASCII_Digits_12345} #{a2ndPositionDigit} #{
Extraction
- Must start with `#{`, not captured. - Must end with `}`, not captured. - Named capture group 'inner' within the brackets. - Must only contain periods, dashes, underscores, unicode letters, and 0-9 digits. - Must contain at least two unicode letters, or at least one unicode letter and digit. - Cannot begin or end with a period. Ex.`#{.foo.}`not matched. - Cannot start with a digit. Ex. `#{42_digitAtStart}` is not matched. - No periods before unicode chars, Ex. `#{_.foo}` is not matched. - Two periods cannot be next to one another. Ex. `#{foo.bar}` is OK, but `#{foo..bar}`, `#{.foo}`, and `#{foo.}` are not. - cannot contain any mix of more than 4 dashes or underscores next to one another. Eg. `#{foo____}` and `#{-_-_foo-bar_-_-}` are OK, but `#{--___ foo}` and `#{bar-_-_--} are not. MUST MATCH #{alpha} #{beta} #{charlie} #{ìñtérnâtiônàlizàtïon} #{مرحبا} #{こんにちは} #{мир} #{-dashes-} #{_under_scores_} #{dots.and-dashes-and_under_scores} #{some_ASCII_Digits_12345} #{a2ndPositionDigit} #{