-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.html
244 lines (235 loc) · 8.63 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
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
<title>Scriptular - Javascript Regular Expression Editor</title>
<link href="https://fonts.googleapis.com/css?family=Reenie+Beanie&text=Scriptular" rel="stylesheet">
<link href="application.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="spine.js"></script>
<script src="application.js"></script>
<script>
$(function() {
new App();
});
</script>
<link rel="apple-touch-icon" sizes="57x57" href="icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="icons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="icons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="icons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="icons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="icons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="icons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="icons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="icons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="icons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
<link rel="manifest" href="/icons/manifest.json">
</head>
<body>
<div id="container">
<div id="header">
<h1><a href="/">Scriptular</a></h1>
<h2>A javascript regular expression editor</h2>
</div>
<div id="main">
<div id="expression">
<h2>Regular Expression:</h2>
/<input name="expression">/<input name="option" type="text" pattern="(g|i|m|u|y)*" spellcheck="false" autocomplete="off" title="Set any flags you want to apply to your expression">
</div>
<div id="test_strings">
<h2>Test Strings:</h2>
<textarea name="test_strings"></textarea>
</div>
<div id="intro">
<p>Scriptular is a javascript regular expression editor. Inspired by <a href="http://rubular.com" target="_blank" rel="noopener">Rubular</a> it gives you a simple way to test javascript regular expressions as you write them.</p>
<p>Start by entering a regular expression and then a test string. Or give this <a href="#" id="example">example a try</a>.</p>
<p><a href="https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions" target="_blank" rel="noopener">Learn more</a> about regular expressions in javascript.</p>
</div>
<div id="error">
<p>No Matches</p>
</div>
<div id="regex-error">
<p>Invalid regular expression</p>
</div>
<div id="output">
<h2>Match Results:</h2>
<ul id="results"></ul>
<h2>Match Groups:</h2>
<ul id="groups"></ul>
<h2>Share Link:</h2>
<ul id="shares">
<li><a id="share_link" href="">Share this regular expression</a></li>
</ul>
</div>
</div>
<div id="quick_reference">
<div class="scrollable">
<table>
<caption><h2>Flags:</h2></caption>
<tr>
<th class="regex">g</th>
<td>Perform a global match</td>
</tr>
<tr>
<th class="regex">i</th>
<td>Perform case-insensitive matching</td>
</tr>
<tr>
<th class="regex">m</th>
<td>Treat beginning and end characters (^ and $) as working over multiple lines</td>
</tr>
<tr>
<th class="regex">u</th>
<td>
Treat the pattern as a series of Unicode code points
(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Regular_expression_and_Unicode_characters" rel="external noopener">
See the MDN docs
</a>)
</td>
</tr>
<tr>
<th class="regex">y</th>
<td>Sticky; treat the pattern after a match as a separate pattern</td>
</tr>
</table>
<h2>Brackets:</h2>
<table>
<tr>
<td class="regex">[abc]</td>
<td>Match a single character a, b, or c</td>
</tr>
<tr>
<td class="regex">[^abc]</td>
<td>Match any character except a, b, or c</td>
</tr>
<tr>
<td class="regex">[A-Za-z]</td>
<td>Match any character from uppercase A to lowercase z</td>
</tr>
<tr>
<td class="regex">(ab|cd|ef)</td>
<td>Match either ab, cd, or ef</td>
</tr>
<tr>
<td class="regex">(...)</td>
<td>Capture anything enclosed</td>
</tr>
</table>
<h2>Metacharacters</h2>
<table>
<tr>
<td class="regex">^</td>
<td>Start of line</td>
</tr>
<tr>
<td class="regex">$</td>
<td>End of line</td>
</tr>
<tr>
<td class="regex">.</td>
<td>Match any character</td>
</tr>
<tr>
<td class="regex">\w</td>
<td>Match a word chracter</td>
</tr>
<tr>
<td class="regex">\W</td>
<td>Match a non-word character</td>
</tr>
<tr>
<td class="regex">\d</td>
<td>Match a digit</td>
</tr>
<tr>
<td class="regex">\D</td>
<td>Match any non-digit character</td>
</tr>
<tr>
<td class="regex">\s</td>
<td>Match a whitespace character</td>
</tr>
<tr>
<td class="regex">\S</td>
<td>Match a non-whitespace character</td>
</tr>
<tr>
<td class="regex">\b</td>
<td>Match character at the beginning or end of a word</td>
</tr>
<tr>
<td class="regex">\B</td>
<td>Match a character not at beginning or end of a word</td>
</tr>
<tr>
<td class="regex">\0</td>
<td>Match a NUL character</td>
</tr>
<tr>
<td class="regex">\t</td>
<td>Match a tab character</td>
</tr>
<tr>
<td class="regex">\xxx</td>
<td>Match a character specified by octal number xxx</td>
</tr>
<tr>
<td class="regex">\xdd</td>
<td>Match a character specified by hexadecimal number dd</td>
</tr>
<tr>
<td class="regex">\uxxxx</td>
<td>Match a Unicode character specified by hexadecimal number xxxx</td>
</tr>
</table>
<h2>Quantifiers</h2>
<table>
<tr>
<td class="regex">n+</td>
<td>Match at least one n</td>
</tr>
<tr>
<td class="regex">n*</td>
<td>Match zero or more n's</td>
</tr>
<tr>
<td class="regex">n?</td>
<td>Match zero or one n</td>
</tr>
<tr>
<td class="regex">n{X}</td>
<td>Match sequence of X n's</td>
</tr>
<tr>
<td class="regex">n{X,Y}</td>
<td>Match sequence of X to Y n's</td>
</tr>
<tr>
<td class="regex">n{X,}</td>
<td>Match sequence of X or more n's</td>
</tr>
</table>
</div>
</div>
<div id="footer">
<p>Created by <a href="http://theprogrammingbutler.com" rel="noopener">Hoyt</a> and maintained by <a href="https://github.com/jonmagic/scriptular#contributors" rel="noopener">many</a>. To contribute or report an issue visit <a href="https://github.com/jonmagic/scriptular" rel="noopener">the project on GitHub</a>.</p>
</div>
</div>
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '4f542216cb25bc2358000006');
t.setAttribute('data-track-path', 'https://track.gaug.es/track.gif');
t.src = 'https://d2fuc4clr7gvcn.cloudfront.net/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>