Skip to content

Commit 33034ae

Browse files
author
Daniel Arthur Gallagher
committed
Add documentation for the 3 other flags
All modern browsers support 5 RegExp flags so I have added documentation for them. I have slightly refactored the Flags table, while preserving the current style.
1 parent 22d14af commit 33034ae

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

application.css

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ a:hover {
172172
margin-bottom: 20px;
173173
}
174174

175+
#quick_reference th,
175176
#quick_reference td {
176177
padding-right: 15px;
177178
line-height:1.5em;
@@ -185,12 +186,6 @@ a:hover {
185186
width:60px;
186187
}
187188

188-
#quick_reference a {
189-
position: absolute;
190-
top: 20px;
191-
right: 20px;
192-
}
193-
194189
input, textarea, #results, #groups {
195190
margin-bottom: 20px;
196191
background-color: white;
@@ -275,10 +270,6 @@ input, textarea, #results, #groups {
275270
padding-left: 30px;
276271
}
277272

278-
#shares li {
279-
280-
}
281-
282273
#shares a {
283274
color: #444;
284275
font-size: 14px;

index.html

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,33 @@ <h2>Share Link:</h2>
7373
</div>
7474

7575
<div id="quick_reference">
76-
<div class="scrollable">
77-
<h2>Modifiers:</h2>
76+
<div class="scrollable">
7877
<table>
78+
<caption><h2>Flags:</h2></caption>
7979
<tr>
80-
<td class="regex">i</td>
80+
<th class="regex">g</th>
81+
<td>Perform a global match</td>
82+
</tr>
83+
<tr>
84+
<th class="regex">i</th>
8185
<td>Perform case-insensitive matching</td>
8286
</tr>
8387
<tr>
84-
<td class="regex">g</td>
85-
<td>Perform a global match</td>
88+
<th class="regex">m</th>
89+
<td>Treat beginning and end characters (^ and $) as working over multiple lines</td>
90+
</tr>
91+
<tr>
92+
<th class="regex">u</th>
93+
<td>
94+
Treat the pattern as a series of Unicode code points
95+
(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Regular_expression_and_Unicode_characters" rel="external noopener">
96+
See the MDN docs
97+
</a>)
98+
</td>
99+
</tr>
100+
<tr>
101+
<th class="regex">y</th>
102+
<td>Sticky; treat the pattern after a match as a separate pattern</td>
86103
</tr>
87104
</table>
88105
<h2>Brackets:</h2>

0 commit comments

Comments
 (0)