forked from vincentlam-teku/regexr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
388 lines (335 loc) · 14.8 KB
/
index.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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<!DOCTYPE html>
<html>
<head>
<title>RegExr: Learn, Build, & Test RegEx</title>
<!-- No frames allowed -->
<script>
if(self !== top) { top.location = self.location; }
</script>
<link rel="canonical" href="http://regexr.com/">
<link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="shortcut icon" href="/assets/favicon.png" type="image/png" />
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta name=viewport content="width=device-width, initial-scale=1, user-scalable=yes">
<meta name="title" content="RegExr: Learn, Build, & Test RegEx" />
<meta name="description" content="Regular expression tester with syntax highlighting, contextual help, video tutorial, reference, and searchable community patterns." />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<!-- Windows8 Pin to home. -->
<meta name="application-name" content="RegExr"/>
<meta name="msapplication-TileColor" content="#44A4E0"/>
<meta name="msapplication-TileImage" content="assets/windows8/mediumtile.png" />
<meta name="msapplication-square70x70logo" content="assets/windows8/smalltile.png"/>
<meta name="msapplication-square150x150logo" content="assets/windows8/mediumtile.png"/>
<meta name="msapplication-wide310x150logo" content="assets/windows8/widetile.png"/>
<meta name="msapplication-square310x310logo" content="assets/windows8/largetile.png"/>
<!-- Apple Touch icon (funnily enough also used by Android) -->
<link rel="apple-touch-icon" sizes="152x152" href="assets/apple/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="144x144" href="assets/apple/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="120x120" href="assets/apple/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="114x114" href="assets/apple/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="76x76" href="assets/apple/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="72x72" href="assets/apple/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" href="assets/apple/apple-touch-icon.png">
<!-- OG Tags for Facebook sharing -->
<meta property="og:image" content="http://regexr.com/assets/og.png"/>
<meta property="og:image:width" content="1200"/>
<meta property="og:image:height" content="630"/>
<meta property="og:title" content="RegExr: Learn, Build, & Test RegEx"/>
<meta property="og:description" content="RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp)."/>
<meta property="og:url" content="http://regexr.com/"/>
<meta property="og:site_name" content="RegExr.com"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:site:id" content="@gskinner"/>
<meta name="twitter:title" content="RegExr: Learn, Build, & Test RegEx"/>
<meta name="twitter:description" content="RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp)."/>
<meta name="twitter:image" content="http://regexr.com/favicon.png"/>
<meta name="twitter:url" content="http://regexr.com" />
<script src="js/scripts.min.js?no=<%=noCache %>"></script>
<script src="js/regExWorker.template.js?no=<%=noCache %>"></script>
<link rel="stylesheet" href="css/regexr.css?no=<%=noCache %>">
</head>
<body>
<div class="top">
<h1 class="icon regexr-logo"></h1><h1 class="regexr-text">RegExr</h1><span class="version regexr-text">v2.1<span class="beta-banner hidden">BETA</span></span>
<div class="links">
by <a href="http://twitter.com/gskinner/" target="_blank">gskinner</a>
<a href="./v1/" target="_blank">RegExr v1</a>
<a href="http://github.com/gskinner/regexr/" target="_blank">GitHub</a>
<a class="video-link">Tutorial</a>
</div>
</div>
<div class="lib hidden" id="libview">
<div class="title">
<span class="button noicon" data-icon="">Library</span>
</div>
<div class="community hidden">
<div class="search">
<span class="search-icon"></span><input type="text" class="search-input" placeholder="Search" tabindex="1" />
</div>
<div class="tag-list-container">
<div class="tag-list" tabindex="2">
<div class="renderer item"><span>{{getLabel()}}</span></div>
</div>
</div>
<div class="community-list" tabindex="3">
<div class="renderer item"><pre class="label">{{getLabel()}}</pre><div class="rating rating-list">{{getStaticRating()}}</div></div>
</div>
<!-- Template for the content. -->
<div class='community-content hidden'>
<div class="header">
<div class="favorite icon"></div>
<div class='load icon all'></div>
<div class="rating rating-content"></div>
</div>
<div class="scroll">
<pre class="description"></pre>
<p class="author"></p>
<hr/>
<div class='load icon expr'></div>
<code class="expression"></code>
<hr/>
<div class="preview-wrap">
<div class='load icon source'></div>
<code class="preview"></code>
<hr/>
</div>
<div class="tool-wrap">
<h1 class="tool-label"></h1>
<hr/>
<div class='load icon tool'></div>
<code class="tool tool-content"></code>
</div>
</div>
</div>
</div>
<div class="list" tabindex="0">
<div class="renderer item"><span class="icon">{{getIcon()}}</span>{{getLabel()}}<span class="detail">{{getDetail()}}</span></div>
</div>
<div class="content">
<b>RegExr is an online tool to <b>learn</b>, <b>build</b>, & <b>test</b> Regular Expressions (RegEx / RegExp).</b>
<hr/>
<ul>
<li>Results update in <b>real-time</b> as you type.</li>
<li><b>Roll over</b> a match or expression for details.</li>
<li><b>Save</b> & <b>share</b> expressions with others.</li>
<li>Use <b>Tools</b> to explore your results.</li>
<li>Browse the <b>Library</b> for help & examples.</li>
<li><b>Undo</b> & <b>Redo</b> with {{getCtrlKey()}}-Z / Y.</li>
<li>Search for & rate <b>Community</b> patterns.</li>
</ul>
</div>
<div id="cheatsheet">
<table class="cheatsheet">
<tr><th colspan="2" onclick="regexr.libView.show('charclasses')">Character classes</th></tr>
<tr><td>.</td><td>any character except newline</td></tr>
<tr><td>\w \d \s</td><td>word, digit, whitespace</td></tr>
<tr><td>\W \D \S</td><td>not word, digit, whitespace</td></tr>
<tr><td>[abc]</td><td>any of a, b, or c</td></tr>
<tr><td>[^abc]</td><td>not a, b, or c</td></tr>
<tr><td>[a-g]</td><td>character between a & g</td></tr>
<tr><th colspan="2" onclick="regexr.libView.show('anchors')">Anchors</th></tr>
<tr><td>^abc$</td><td>start / end of the string</td></tr>
<tr><td>\b \B</td><td>word, not-word boundary</td></tr>
<tr><th colspan="2" onclick="regexr.libView.show('escchars')">Escaped characters</th></tr>
<tr><td>\. \* \\</td><td>escaped special characters</td></tr>
<tr><td>\t \n \r</td><td>tab, linefeed, carriage return</td></tr>
<tr><td>\u00A9</td><td>unicode escaped ©</td></tr>
<tr><th colspan="2" onclick="regexr.libView.show('groups')">Groups & Lookaround</th></tr>
<tr><td>(abc)</td><td>capture group</td></tr>
<tr><td>\1</td><td>backreference to group #1</td></tr>
<tr><td>(?:abc)</td><td>non-capturing group</td></tr>
<tr><td>(?=abc)</td><td>positive lookahead</td></tr>
<tr><td>(?!abc)</td><td>negative lookahead</td></tr>
<tr><th colspan="2" onclick="regexr.libView.show('quants')">Quantifiers & Alternation</th></tr>
<tr><td>a* a+ a?</td><td>0 or more, 1 or more, 0 or 1</td></tr>
<tr><td>a{5} a{2,}</td><td>exactly five, two or more</td></tr>
<tr><td>a{1,3}</td><td>between one & three</td></tr>
<tr><td>a+? a{2,}?</td><td>match as few as possible</td></tr>
<tr><td>ab|cd</td><td>match ab or cd</td></tr>
</table>
</div>
</div>
<div class="doc tools-disabled" id="docview">
<div class="title expr">
Expression
<ul class="buttonbar">
<li class="button share" data-icon="">share</li> <!-- share: E309, new win: E152 -->
<li class="button save" data-icon="">save</li> <!-- file: E359, bookmark: E073-->
<li class="button flags" data-icon="">flags</li>
</ul>
</div>
<div class="editor expr"><div class="results"></div></div>
<div class="title source">
Text
</div>
<div class="editor source">
<div class="measure"></div>
<canvas class="canvas" width="1" height="1"></canvas>
<textarea class="default">
Welcome to RegExr v2.1 by gskinner.com, proudly hosted by Media Temple!
Edit the Expression & Text to see matches. Roll over matches or the expression for details. Undo mistakes with {{ctrl}}-z. Save Favorites & Share expressions with friends or the Community. Explore your results with Tools. A full Reference & Help is available in the Library, or watch the video Tutorial.
Sample text for testing:
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789 _+-.,!@#$%^&*();\/|<>"'
12345 -98.7 3.141 .6180 9,000 +42
555.123.4567 +1-(800)-555-2468
www.demo.com http://foo.co.uk/
http://regexr.com/foo.html?q=bar
https://mediatemple.net
</textarea>
</div>
<div class="title tools">
<span>Tools</span>
<ul class="buttonbar right">
<li class="button nolabel expand" data-icon="" data-alticon=""></li>
</ul>
<ul class="buttonbar left">
<!-- If these labels are changed, also update Favorites.js -->
<li class="button replace active" data-tool="replace">Replace</li>
<li class="button list" data-tool="list">List</li>
<li class="button details" data-tool="details">Details</li>
<li class="button explain" data-tool="explain">Explain</li>
</ul>
</div>
<div class="tools editor replace"></div>
<div class="tools editor list"></div>
<div class="tools editor out"></div>
<div class="tools results"><div class="content"></div></div>
<div class="menu flags">
<header>
Expression Flags
<ul class="buttonbar">
<li class="button help" data-icon=""></li>
</ul></header>
<hr/>
<a class="check" data-flag="i"> ignore case <code>(i)</code></a><br/>
<a class="check" data-flag="g"> global <code>(g)</code></a><br/>
<a class="check" data-flag="m"> multiline <code>(m)</code></a><br/>
</div>
<div class="menu share">
<div id="savePrompt">
<p><a id="showSaveLink">Save</a> your pattern before sharing.</p>
</div>
<div class="share-wrap">
<header>
Share
</header>
<hr />
<div id="shareLinkView" class="share-wrap">
<input type="text" id="shareLinkTxt" readonly>
<div data-clipboard-target="#shareLinkTxt" class="icon share-link-btn"></div>
</div>
</div>
<header>
Expression
</header>
<hr />
<div id="shareExpressionView" class="share-wrap">
<input type="text" id="shareExpressionTxt" readonly>
<div class="icon share-expression-btn" data-clipboard-target="#shareExpressionTxt"></div>
</div>
<header>
Pattern
</header>
<hr />
<div id="sharePatternView" class="share-wrap">
<input type="text" id="sharePatternTxt" readonly>
<div class="icon share-pattern-btn" data-clipboard-target="#sharePatternTxt"></div>
</div>
<header>
Javascript
</header>
<hr />
<div id="shareJavascriptView" class="share-wrap">
<input type="text" id="shareJavascriptTxt" readonly>
<div class="icon share-javascript-btn" data-clipboard-target="#shareJavascriptTxt"></div>
</div>
</div>
<div class="menu save">
<header>
Save
</header>
<hr />
<div id="saveView" class="hidden">
<div class="public-wrap">
<header class="sub-header">
Add to
</header>
<hr/>
<a id="publicChk" class="check"> Community</a><br/>
<a id="favouriteChk" class="check"> Favourites</a><br/>
<hr/>
</div>
<div class="save-details-wrap hidden">
<label for="titleTxt">name</label> <span id="titleTxt-req">*</span><br />
<input id="titleTxt" type="text" max="30" maxlength="30" required><br />
<label for="descriptionTxt">description</label><br />
<textarea id="descriptionTxt" rows="3" max="250" maxlength="250"></textarea> <br />
<label for="tagsTxt">tags</label><br />
<input id="tagsTxt" type="text" max="50" maxlength="50"><br />
<div class="tag-list-container">
<div class="tag-list" tabindex="2">
<div class="renderer item"><span>{{getLabel()}}</span></div>
</div>
</div>
<label for="authorTxt">author</label><br />
<input id="authorTxt" type="text" max="20" maxlength="20"><br />
</div>
<input id="saveBtn" type="button" class="save-button" value="Save">
<input id="updateBtn" type="button" class="update-button" value="Update">
<div id="errorMessage" class="error-default">
<hr />
<p>There was an error saving your pattern.</p>
<p>Please try again later.</p>
</div>
</div>
<div class="success hidden">
Pattern saved. You can now <a id="showShareLink">share</a> your pattern.
</div>
<div class="no-changes hidden">
No changes since last save.
</div>
</div>
</div>
<div class="video hidden">
<!--
*******************************
*** Note the ?enablejsapi=1 ***
*******************************
It's required so we can play and pause the video.
-->
<iframe width="854" height="510" frameborder="0" allowfullscreen></iframe>
</div>
<!-- White spinner with an #242429 background. Used in the Community and Favourites header. -->
<img class="hidden spinner" src="assets/spinner.gif" inline />
<!-- White spinner used in the community search. -->
<img class="hidden spinner white" src="assets/spinnerWhite.gif" inline />
<div class="not-supported-mobile hidden">
<div class="top">
<h1 class="icon regexr-logo"></h1><h1 class="regexr-text">RegExr</h1><span class="version regexr-text">v2.0</span>
</div>
<div class="content">
<p>RegExr isn't optimized for mobile devices yet. You can still take a look, but it might be a bit quirky.</p>
<a id="closeOverlay"><b>></b> Okay!</a>
</div>
</div>
<div class="not-supported hidden">
<div class="top">
<h1 class="icon regexr-logo"></h1>
<h1 class="regexr-text">RegExr</h1><span class="version regexr-text">v2.1</span>
</div>
<div class="content">
<p>RegExr requires a modern browser. Please update your browser to the latest version and try again.</p>
<p class="flash hidden">If you have Flash support you can still visit <a href="v1/">RegExr version 1</a></p>
</div>
</div>
<!--
To fix showing the "Not supported" screen in IE 7 (and other old browsers).
Since our initial load can cause errors, we just catch them and show the overlay if they happen.
-->
<script src="js/checkSupport.template.js" inline></script>
<script src="js/analytics.template.js" inline></script>
<script src="js/index.template.js" inline></script>
</body>
</html>