-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
110 lines (106 loc) · 3.15 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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="container">
<h1><strong>Regex Text Replacer</strong></h1>
<p><em>Use regex to replace arguments within text.</em></p>
<hr />
<div id="replacer">
<form>
<p>
Regex<br />
<small>
Note: You should not include regex flags. / at the start and end
of regex is optional.
</small>
</p>
<p>
<textarea
id="regex"
name="regex"
placeholder="/this|or|that/"
rows="1"
cols="50"
></textarea>
</p>
<p>Regex Flags</p>
<p>
<details>
<summary>What's this?</summary>
<h3>What are regex flags?</h3>
<ul>
<li>
<code>g</code> - Replaces all matches, stands for 'global'.
<em
>(used by default for this tool, if no custom flag is
provided)</em
>
</li>
<li>
<code>gi</code> - Replaces all matches, doesn't matter if it's
lower or upper case. Stands for 'global insensitive'.
</li>
<li>
<code>i</code> - Replaces the first match only, doesn't matter
if it's lower or upper case. Stands for 'insensitive'.
</li>
<li>
<code>m</code> - Multiline search, stands for 'multiline'.
</li>
<li>
<code>none</code> - No flags. Will only replace the first
match.
</li>
</ul>
</details>
</p>
<p>
<select id="flags">
<option disabled selected value="g">
Select a regex flag...
</option>
<option value="g">g</option>
<option value="gi">gi</option>
<option value="i">i</option>
<option value="m">m</option>
<option value="">none</option>
</select>
</p>
<p>Text</p>
<p>
<textarea
id="text"
name="text"
placeholder="Some text"
rows="1"
cols="50"
></textarea>
</p>
<p>Replacer</p>
<p>
<textarea
id="replace"
name="replacer"
placeholder="Hello World!"
rows="1"
cols="50"
></textarea>
</p>
</form>
<button type="button" id="Replace" onclick="replaceThis()">
Replace!
</button>
</div>
<div id="new"></div>
</div>
</body>
</html>
<script type="text/javascript" src="script.js"></script>
<footer>
Made With ❤️ |
<a href="https://github.com/DevSpen/regex-replacer">View Source</a>
</footer>