UNPKG

6.07 kBTypeScriptView Raw
1/**
2 * Regular expression to match upper and lowercase ASCII letters
3 */
4export declare const letterRe: RegExp;
5/**
6 * Regular expression to match ASCII digits
7 */
8export declare const digitRe: RegExp;
9/**
10 * Regular expression to match everything *except* ASCII digits
11 */
12export declare const nonDigitRe: RegExp;
13/**
14 * Regular expression to match whitespace
15 */
16export declare const whitespaceRe: RegExp;
17/**
18 * Regular expression to match quote characters
19 */
20export declare const quoteRe: RegExp;
21/**
22 * Regular expression to match the range of ASCII control characters (0-31), and
23 * the backspace char (127)
24 */
25export declare const controlCharsRe: RegExp;
26/**
27 * The string form of a regular expression that would match all of the
28 * alphabetic ("letter") chars in the unicode character set when placed in a
29 * RegExp character class (`[]`). This includes all international alphabetic
30 * characters.
31 *
32 * These would be the characters matched by unicode regex engines `\p{L}`
33 * escape ("all letters").
34 *
35 * Taken from the XRegExp library: http://xregexp.com/ (thanks @https://github.com/slevithan)
36 * Specifically: http://xregexp.com/v/3.2.0/xregexp-all.js, the 'Letter'
37 * regex's bmp
38 *
39 * VERY IMPORTANT: This set of characters is defined inside of a Regular
40 * Expression literal rather than a string literal to prevent UglifyJS from
41 * compressing the unicode escape sequences into their actual unicode
42 * characters. If Uglify compresses these into the unicode characters
43 * themselves, this results in the error "Range out of order in character
44 * class" when these characters are used inside of a Regular Expression
45 * character class (`[]`). See usages of this const. Alternatively, we can set
46 * the UglifyJS option `ascii_only` to true for the build, but that doesn't
47 * help others who are pulling in Autolinker into their own build and running
48 * UglifyJS themselves.
49 */
50export declare const alphaCharsStr: string;
51/**
52 * The string form of a regular expression that would match all emoji characters
53 * Based on the emoji regex defined in this article: https://thekevinscott.com/emojis-in-javascript/
54 */
55export declare const emojiStr: string;
56/**
57 * The string form of a regular expression that would match all of the
58 * combining mark characters in the unicode character set when placed in a
59 * RegExp character class (`[]`).
60 *
61 * These would be the characters matched by unicode regex engines `\p{M}`
62 * escape ("all marks").
63 *
64 * Taken from the XRegExp library: http://xregexp.com/ (thanks @https://github.com/slevithan)
65 * Specifically: http://xregexp.com/v/3.2.0/xregexp-all.js, the 'Mark'
66 * regex's bmp
67 *
68 * VERY IMPORTANT: This set of characters is defined inside of a Regular
69 * Expression literal rather than a string literal to prevent UglifyJS from
70 * compressing the unicode escape sequences into their actual unicode
71 * characters. If Uglify compresses these into the unicode characters
72 * themselves, this results in the error "Range out of order in character
73 * class" when these characters are used inside of a Regular Expression
74 * character class (`[]`). See usages of this const. Alternatively, we can set
75 * the UglifyJS option `ascii_only` to true for the build, but that doesn't
76 * help others who are pulling in Autolinker into their own build and running
77 * UglifyJS themselves.
78 */
79export declare const marksStr: string;
80/**
81 * The string form of a regular expression that would match all of the
82 * alphabetic ("letter") chars, emoji, and combining marks in the unicode character set
83 * when placed in a RegExp character class (`[]`). This includes all
84 * international alphabetic characters.
85 *
86 * These would be the characters matched by unicode regex engines `\p{L}\p{M}`
87 * escapes and emoji characters.
88 */
89export declare const alphaCharsAndMarksStr: string;
90/**
91 * The string form of a regular expression that would match all of the
92 * decimal number chars in the unicode character set when placed in a RegExp
93 * character class (`[]`).
94 *
95 * These would be the characters matched by unicode regex engines `\p{Nd}`
96 * escape ("all decimal numbers")
97 *
98 * Taken from the XRegExp library: http://xregexp.com/ (thanks @https://github.com/slevithan)
99 * Specifically: http://xregexp.com/v/3.2.0/xregexp-all.js, the 'Decimal_Number'
100 * regex's bmp
101 *
102 * VERY IMPORTANT: This set of characters is defined inside of a Regular
103 * Expression literal rather than a string literal to prevent UglifyJS from
104 * compressing the unicode escape sequences into their actual unicode
105 * characters. If Uglify compresses these into the unicode characters
106 * themselves, this results in the error "Range out of order in character
107 * class" when these characters are used inside of a Regular Expression
108 * character class (`[]`). See usages of this const. Alternatively, we can set
109 * the UglifyJS option `ascii_only` to true for the build, but that doesn't
110 * help others who are pulling in Autolinker into their own build and running
111 * UglifyJS themselves.
112 */
113export declare const decimalNumbersStr: string;
114/**
115 * The regular expression that will match all of the letters and decimal number
116 * chars in the unicode character set when placed in a RegExp character class
117 * (`[]`).
118 *
119 * These would be the characters matched by unicode regex engines
120 * `[\p{L}\p{Nd}]` escape ("all letters and decimal numbers")
121 */
122export declare const alphaNumericCharsRe: RegExp;
123/**
124 * The string form of a regular expression that would match all of the
125 * letters, combining marks, and decimal number chars in the unicode character
126 * set when placed in a RegExp character class (`[]`).
127 *
128 * These would be the characters matched by unicode regex engines
129 * `[\p{L}\p{M}\p{Nd}]` escape ("all letters, combining marks, and decimal
130 * numbers")
131 */
132export declare const alphaNumericAndMarksCharsStr: string;
133/**
134 * The regular expression that will match a single letter of the
135 * {@link #alphaNumericAndMarksCharsStr}.
136 */
137export declare const alphaNumericAndMarksRe: RegExp;