-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
154 lines (140 loc) · 5.57 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
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" type="image/png" href="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/OOjs_UI_icon_regular-expression.svg/24px-OOjs_UI_icon_regular-expression.svg.png"/>
<title>Regenerate : Generate languages from regular expressions</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.3/css/foundation.min.css" crossorigin="anonymous" />
<link rel="stylesheet" href="static/fork.min.css">
<link rel="stylesheet" href="regenerate.css" />
</head>
<body>
<div class="grid-container">
<div class="grid-x grid-margin-x">
<div class="cell auto"></div>
<div class="cell small-8">
<h1 class="text-center">Regenerate</h1>
<p class="lead">
Regenerate is a tool to generate test-cases for regular expression engines.
</p>
<p class="text-justify">
Regenerate takes a <a href="https://en.wikipedia.org/wiki/Regular_expression"><em>regular</em> expression</a> and generates strings that match it.
It handles most posix extended regular expressions along with
complement (<code>~a</code>) and intersection (<code>a&b</code>). See
the <a data-open="explanationRe">help</a> for details.
Since it handles complement, it can also generate strings that
<em>don't</em> match a given regular expression.
Below, we generate both positive and negative examples for the
language composed of the letter 'a' and 'b'.
See our <a href="static/gpce18.pdf">paper</a> for details.
</p>
<p class="text-justify">
Regenerate is made with <a href="https://ocaml.org/">OCaml</a> and a couple
of cool
OCaml libraries. The native tool and the library are available on
<a href="https://opam.ocaml.org/packages/regenerate/">opam</a>.
This page was made with the awesome
<a href="http://ocsigen.org/js_of_ocaml/">js_of_ocaml</a> compiler.
The source code is available <a href="https://github.com/regex-generate/Regenerate">on github</a>.
</p>
<form id="re-form">
<div class="input-group grid-x">
<input class="input-group-field cell small-3 auto" id="re-input"
placeholder="Regular expression"
type="text"/>
<a class="input-group-label" data-open="explanationRe">?</a>
<div class="input-group-button">
<button type="button" class="button" id="re-gen">Generate</button>
<button type="button" class="button dropdown arrow-only"
data-toggle="re-menu" >
<span class="show-for-sr">Examples</span>
</button>
</div>
</div>
<div class="input-group grid-x">
<select class="input-group-field cell shrink" id="mode-select">
<option selected="selected" value="sample">Select some samples</option>
<option value="all">Give me everything</option>
</select>
<div class="input-group-button cell auto">
<input type="submit" class="button expanded" value="Go!">
</div>
</div>
</form>
<div id="fail"></div>
</div>
<div class="cell auto"></div>
</div>
<div class="grid-x align-center grid-margin-x is-hidden instances" id="instances">
<div class="cell small-5 positive">
<h2 class="subheader">Positive instances</h2>
<ul class="no-bullet" id="pos-instances"></ul>
<div id="pos-msg"></div>
</div>
<div class="cell small-5 negative">
<h2 class="subheader">Negative instances</h2>
<ul class="no-bullet" id="neg-instances"></ul>
<div id="neg-msg"></div>
</div>
</div>
</div>
<div class="dropdown-pane"
id="re-menu"
data-position="bottom" data-alignment="right" data-dropdown
data-hover="true" data-hover-pane="true">
<ul class="vertical menu" id="re-list">
<li class="menu-text">Some interesting examples:</li>
</ul>
</div>
<div class="small reveal" id="explanationRe" data-reveal>
<h1>Which regular expressions?</h1>
<p class="lead">You can use most posix extended regular expressions plus complement and intersection.
More precisely:</p>
<ul>
<li><code>a</code>: A single char.</li>
<li><code>[ab]</code>: Character sets.
<ul>
<li><code>[^ab]</code>: Complement Character sets.</li>
<li><code>[a-c]</code>: Character ranges.</li>
</ul>
</li>
<li><code>ab</code>: Sequence.</li>
<li><code>a|b</code>: Alternative.</li>
<li><code>a&b</code>: Intersection.</li>
<li><code>~a</code>: Complement.</li>
<li><code>a{i,j}</code>: Repetition.
<ul>
<li><code>a*</code> is <code>a{0,}</code></li>
<li><code>a+</code> is <code>a{1,}</code></li>
<li><code>a?</code> is <code>a{0,1}</code></li>
</ul>
</li>
</ul>
<p>Back references, character classes, anchoring and lookahead/lookbehind are not
supported.</p>
<button class="close-button" data-close aria-label="Close modal" type="button">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="fork-me-wrapper">
<div class="fork-me">
<a class="fork-me-link" href="https://github.com/regex-generate/Regenerate">
<span class="fork-me-text">Fork Me On GitHub</span>
</a>
</div>
</div>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
crossorigin="anonymous"></script>
<script
src="regenerate_web.bc.js" ></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.3/js/foundation.min.js"
crossorigin="anonymous"></script>
<script>
$(document).foundation();
</script>
</body>
</html>