-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathStyle.regex.txt
149 lines (148 loc) · 7.4 KB
/
Style.regex.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Matches an ANSI style (color or text option)
(?>
(?<Console_Reset>
\e # An Escape
\[ # Followed by a bracket
(?<Reset>0m) # 0m indicates reset
)
|
(?<Console_Bold>
\e # An Escape
\[ # Followed by a bracket
(?>
(?<BoldStart>1m) |
(?<BoldEnd>22m))
)
|
(?<Console_Blink>
\e # An Escape
\[ # Followed by a bracket
(?>
(?>
(?<BlinkStart>(?<BlinkSlow>5m) # 5m starts a slow blink
|
(?<BlinkFast>6m) # 6m starts a slow blink
)) |
(?<BlinkEnd>25m) # 25m stops blinks
)
)
|
(?<Console_Faint>
\e # An Escape
\[ # Followed by a bracket
(?>
(?<FaintStart>2m) # 2m starts faint
|
(?<FaintEnd>22m) # 22m stops faint
)
)
|
(?<Console_Italic>
\e # An Escape
\[ # Followed by a bracket
(?>
(?<ItalicStart>3m) # 3m starts italic
|
(?<ItalicEnd>23m) # 23m stops italic
)
)
|
(?<Console_Invert>
\e # An Escape
\[ # Followed by a bracket
(?>
(?<InvertStart>7m) # 7m starts invert
|
(?<InvertEnd>27m) # 27m stops invert
)
)
|
(?<Console_Hide>
\e # An Escape
\[ # Followed by a bracket
(?>
(?<HideStart>8m) # 8m starts hide
|
(?<HideEnd>28m) # 28m stops hide
)
)
|
(?<Console_Strikethrough>
\e # An Escape
\[ # Followed by a bracket
(?>
(?<StrikethroughStart>9m) # 9m starts Strikethrough
|
(?<StrikethroughEnd>29m) # 29m stops Strikethrough
)
)
|
(?<Console_Underline>
\e # An Escape
\[ # Followed by a bracket
(?>
(?<UnderlineStart>4m) # 4m starts underline
|
(?<DoubleUnderlineStart>21m) # 21m start a double underline
|
(?<UnderlineEnd>24m) # 24m stops underline
)
)
|
(?<Console_24BitColor>
(?-i)\e # An Escape
\[ # Followed by a bracket
(?>
(?<IsForegroundColor>38) |
(?<IsBackgroundColor>48) |
(?<IsUnderlineColor>58));2;(?<Color>(?<Red>(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Red is the first 0-255 value
;(?<Green>(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Green is the second 0-255 value
;(?<Blue>(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # Blue is the third 0-255 value
m)
)
|
(?<Console_8BitColor>
(?-i)\e # An Escape
\[ # Followed by a bracket
(?>
(?<IsForegroundColor>38) |
(?<IsBackgroundColor>48) |
(?<IsUnderlineColor>58));5;(?<Color>(?>
(?<StandardColor>[0-7]) # 0 -7 are standard colors
m |
(?<BrightColor>(?>[8-9]|1[0-5])) # 8-15 are bright colors
m |
(?<CubeColor>(?>[0-2][0-3][0-1]|[0-1]\d\d|\d{1,2})) # 16-231 are cubed colors
m |
(?<GrayscaleColor>(?>[0-2][0-5][0-5]|[0-1]\d\d|\d{1,2})) # 232-255 are grayscales
m))
)
|
(?<Console_4BitColor>
\e # An Escape
\[ # Followed by a bracket
(?<Color>(?>
(?<IsBright>1)?\;{0,1} # A 1 and a semicolon indicate a bright color
(?<IsForegroundColor>3) # A number that starts with 3 indicates foreground color
|
(?<IsBright>(?<IsForegroundColor>9)) # OR it could be a less common bright foreground color, which starts with 9
|
(?<IsBright>1)?\;{0,1} # A 1 and a semicolon indicate a bright color
(?<IsBackgroundColor>4) # A number that starts with 3 indicates foreground color
|
(?<IsBright>(?<IsBackgroundColor>10)) # OR it could be a less common bright foreground color, which starts with 9
)(?<ColorNumber>[0-7]) # The color number will be between 0 and 7
(?:\;{0,1}(?<IsBright>1)?)? # Brightness can also come after a color
m)
)
|
(?<Console_DefaultColor>
(?-i)\e # An Escape
\[ # Followed by a bracket
(?<Color>(?>
(?<DefaultForeground>39) # 39 Represents the default foreground color
m |
(?<DefaultForeground>49) # 49 Represents the default background color
m))
)
)