-
Notifications
You must be signed in to change notification settings - Fork 12
/
challenge19.html
246 lines (235 loc) · 8.75 KB
/
challenge19.html
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Regex Challenge - Week Nineteen</title>
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:200,400' rel='stylesheet'>
<link rel="stylesheet" href="assets/style.css">
</head>
<body>
<header>
<h1>Regex Tuesday Challenge - Week Nineteen</h1>
<nav>
<a href="./">« View all Challenges</a>
</nav>
<div id='social'>
<a href="https://twitter.com/share" class="twitter-share-button" data-via="callumacrae" data-hashtags="regextuesday">Tweet</a>
<div class="g-plusone" data-size="medium"></div>
<div class="fb-like" data-send="false" data-layout="button_count" data-width="75" data-show-faces="false" style="top: -4px"></div>
<div style='display: inline-block; position: relative; margin-left: 30px; top: 3px;'>
<script type="text/javascript" src="//pay.reddit.com/static/button/button1.js"></script>
</div>
</div>
</header>
<section>
<p>Challenge number nineteen is another golf challenge; in this challenge, you must match all the valid HTML tag names in as few characters as possible. You match <em>only valid tag names</em> - more failing test cases may be added later.</p>
<p>To test a regular expression on the test cases below, type it into the text input. Each test case will be marked as passed or failed respectively - you are aiming to get as many test cases as you can to pass. Note that JavaScript must be enabled for this feature to work. The regex engine used is the JavaScript regex engine; it is similar to PCRE, but with a few differences.</p>
<p class='single-input'>
<textarea id="find" placeholder="/regexp? here/i"></textarea>
</p>
<h3>Test cases (<span id='passed-count'>0</span>/168) <a id='permalink' class='button' href='./challenge17.html'>Permalink</a> <label id="hide_passing"><input type="checkbox"> Hide passing tests</label></h3>
<dl id='tests'>
<dt>a</dt><dd>match</dd>
<dt>abbr</dt><dd>match</dd>
<dt>address</dt><dd>match</dd>
<dt>area</dt><dd>match</dd>
<dt>article</dt><dd>match</dd>
<dt>aside</dt><dd>match</dd>
<dt>audio</dt><dd>match</dd>
<dt>b</dt><dd>match</dd>
<dt>base</dt><dd>match</dd>
<dt>bdi</dt><dd>match</dd>
<dt>bdo</dt><dd>match</dd>
<dt>blockquote</dt><dd>match</dd>
<dt>body</dt><dd>match</dd>
<dt>br</dt><dd>match</dd>
<dt>button</dt><dd>match</dd>
<dt>canvas</dt><dd>match</dd>
<dt>caption</dt><dd>match</dd>
<dt>cite</dt><dd>match</dd>
<dt>code</dt><dd>match</dd>
<dt>col</dt><dd>match</dd>
<dt>colgroup</dt><dd>match</dd>
<dt>command</dt><dd>match</dd>
<dt>datalist</dt><dd>match</dd>
<dt>dd</dt><dd>match</dd>
<dt>del</dt><dd>match</dd>
<dt>details</dt><dd>match</dd>
<dt>dfn</dt><dd>match</dd>
<dt>div</dt><dd>match</dd>
<dt>dl</dt><dd>match</dd>
<dt>dt</dt><dd>match</dd>
<dt>em</dt><dd>match</dd>
<dt>embed</dt><dd>match</dd>
<dt>fieldset</dt><dd>match</dd>
<dt>figcaption</dt><dd>match</dd>
<dt>figure</dt><dd>match</dd>
<dt>footer</dt><dd>match</dd>
<dt>form</dt><dd>match</dd>
<dt>h1</dt><dd>match</dd>
<dt>h2</dt><dd>match</dd>
<dt>h3</dt><dd>match</dd>
<dt>h4</dt><dd>match</dd>
<dt>h5</dt><dd>match</dd>
<dt>h6</dt><dd>match</dd>
<dt>head</dt><dd>match</dd>
<dt>header</dt><dd>match</dd>
<dt>hgroup</dt><dd>match</dd>
<dt>hr</dt><dd>match</dd>
<dt>html</dt><dd>match</dd>
<dt>i</dt><dd>match</dd>
<dt>iframe</dt><dd>match</dd>
<dt>img</dt><dd>match</dd>
<dt>input</dt><dd>match</dd>
<dt>ins</dt><dd>match</dd>
<dt>kbd</dt><dd>match</dd>
<dt>keygen</dt><dd>match</dd>
<dt>label</dt><dd>match</dd>
<dt>legend</dt><dd>match</dd>
<dt>li</dt><dd>match</dd>
<dt>link</dt><dd>match</dd>
<dt>map</dt><dd>match</dd>
<dt>mark</dt><dd>match</dd>
<dt>menu</dt><dd>match</dd>
<dt>meta</dt><dd>match</dd>
<dt>meter</dt><dd>match</dd>
<dt>nav</dt><dd>match</dd>
<dt>noscript</dt><dd>match</dd>
<dt>object</dt><dd>match</dd>
<dt>ol</dt><dd>match</dd>
<dt>optgroup</dt><dd>match</dd>
<dt>option</dt><dd>match</dd>
<dt>output</dt><dd>match</dd>
<dt>p</dt><dd>match</dd>
<dt>param</dt><dd>match</dd>
<dt>pre</dt><dd>match</dd>
<dt>progress</dt><dd>match</dd>
<dt>q</dt><dd>match</dd>
<dt>rp</dt><dd>match</dd>
<dt>rt</dt><dd>match</dd>
<dt>ruby</dt><dd>match</dd>
<dt>s</dt><dd>match</dd>
<dt>samp</dt><dd>match</dd>
<dt>script</dt><dd>match</dd>
<dt>section</dt><dd>match</dd>
<dt>select</dt><dd>match</dd>
<dt>small</dt><dd>match</dd>
<dt>source</dt><dd>match</dd>
<dt>span</dt><dd>match</dd>
<dt>strong</dt><dd>match</dd>
<dt>style</dt><dd>match</dd>
<dt>sub</dt><dd>match</dd>
<dt>summary</dt><dd>match</dd>
<dt>sup</dt><dd>match</dd>
<dt>table</dt><dd>match</dd>
<dt>tbody</dt><dd>match</dd>
<dt>td</dt><dd>match</dd>
<dt>textarea</dt><dd>match</dd>
<dt>tfoot</dt><dd>match</dd>
<dt>th</dt><dd>match</dd>
<dt>thead</dt><dd>match</dd>
<dt>time</dt><dd>match</dd>
<dt>title</dt><dd>match</dd>
<dt>tr</dt><dd>match</dd>
<dt>track</dt><dd>match</dd>
<dt>u</dt><dd>match</dd>
<dt>ul</dt><dd>match</dd>
<dt>var</dt><dd>match</dd>
<dt>video</dt><dd>match</dd>
<dt>wbr</dt><dd>match</dd>
<dt>ab</dt><dd>no match</dd>
<dt>acronym</dt><dd>no match</dd>
<dt>applet</dt><dd>no match</dd>
<dt>az</dt><dd>no match</dd>
<dt>ba</dt><dd>no match</dd>
<dt>basefont</dt><dd>no match</dd>
<dt>big</dt><dd>no match</dd>
<dt>c</dt><dd>no match</dd>
<dt>center</dt><dd>no match</dd>
<dt>d</dt><dd>no match</dd>
<dt>dad</dt><dd>no match</dd>
<dt>dir</dt><dd>no match</dd>
<dt>e</dt><dd>no match</dd>
<dt>eb</dt><dd>no match</dd>
<dt>f</dt><dd>no match</dd>
<dt>font</dt><dd>no match</dd>
<dt>frame</dt><dd>no match</dd>
<dt>frameset</dt><dd>no match</dd>
<dt>g</dt><dd>no match</dd>
<dt>ga</dt><dd>no match</dd>
<dt>gurtrood</dt><dd>no match</dd>
<dt>h</dt><dd>no match</dd>
<dt>h0</dt><dd>no match</dd>
<dt>h7</dt><dd>no match</dd>
<dt>h10</dt><dd>no match</dd>
<dt>in</dt><dd>no match</dd>
<dt>j</dt><dd>no match</dd>
<dt>jam</dt><dd>no match</dd>
<dt>k</dt><dd>no match</dd>
<dt>key</dt><dd>no match</dd>
<dt>l</dt><dd>no match</dd>
<dt>la</dt><dd>no match</dd>
<dt>m</dt><dd>no match</dd>
<dt>man</dt><dd>no match</dd>
<dt>n</dt><dd>no match</dd>
<dt>o</dt><dd>no match</dd>
<dt>old</dt><dd>no match</dd>
<dt>put</dt><dd>no match</dd>
<dt>queen</dt><dd>no match</dd>
<dt>r</dt><dd>no match</dd>
<dt>rn</dt><dd>no match</dd>
<dt>slower</dt><dd>no match</dd>
<dt>strike</dt><dd>no match</dd>
<dt>t</dt><dd>no match</dd>
<dt>tab</dt><dd>no match</dd>
<dt>tf</dt><dd>no match</dd>
<dt>tt</dt><dd>no match</dd>
<dt>un</dt><dd>no match</dd>
<dt>v</dt><dd>no match</dd>
<dt>vw</dt><dd>no match</dd>
<dt>vehicle</dt><dd>no match</dd>
<dt>w</dt><dd>no match</dd>
<dt>weird</dt><dd>no match</dd>
<dt>x</dt><dd>no match</dd>
<dt>xx</dt><dd>no match</dd>
<dt>y</dt><dd>no match</dd>
<dt>yahooa</dt><dd>no match</dd>
<dt>z</dt><dd>no match</dd>
<dt>zebra</dt><dd>no match</dd>
<dt>zebras</dt><dd>no match</dd>
</dl>
<div id="congratulations">Congratulations, your regex passes all the test cases! Remember to share this challenge.</div>
</section>
<footer>
Public domain. Site by <a href="http://macr.ae/">Callum Macrae</a>
</footer>
<script src="assets/challenge.js"></script>
<!-- Social media -->
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<script type="text/javascript">
window.___gcfg = {lang: 'en-GB'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=251120905643";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-10431066-8']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>