Skip to content

Commit 5515bf8

Browse files
committed
Tweaks to the help content for infinite and timeout errors.
Signed-off-by: Grant Skinner <[email protected]>
1 parent 2424eba commit 5515bf8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

js/documentation.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ var library = {
2727
"<p>RegExr uses your browser's RegExp engine for matching, and its syntax highlighting and documentation reflect the Javascript RegExp standard.</p>"
2828
},
2929
{
30+
id:"infinite",
31+
label:"The 'infinite' error",
32+
desc:"The expression can match 0 characters, and therefore matches infinitely.",
33+
ext:" <h1>Example:</h1><code>.*</code> can match an empty string of <code>0</code> characters, and therefore will match infinitely."
34+
},
35+
{
36+
id:"timeout",
37+
label:"The 'timeout' error",
38+
desc:"The expression took longer than 250ms to execute.",
39+
ext:" For some expressions the time to execute grows exponentially, often due to nested quantifiers. <h1>Example:</h1> When <code>(a+)+Z</code> is executed on <code>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</code> it attempts to match any number of 'a' characters any number of times, which results in exponential growth."
40+
},
41+
{
3042
label:"Getting started",
3143
desc:"RegExr provides real-time visual results, syntax highlighting, tooltips, and undo/redo ({{getCtrlKey()}}-Z / Y) so it's easy and fun to explore Regular Expressions."+
3244
"<p>Browse through the <b>Reference</b> and test different tokens to see what they do, then check out the <b>Examples</b> to see how tokens work together.</p>"
@@ -55,18 +67,6 @@ var library = {
5567
desc:"The <b>Library</b> includes help content and a reference that includes info on all regular expression tokens and flags."+
5668
"<p>Tap a selected item in the reference to insert it into your <b>Expression</b>. Click the <span class='icon'>&#xE212;</span> beside an example to load it.</p>"+
5769
"<p>The library also includes example patterns, searchable community submissions, and your saved favourites.</p>"
58-
},
59-
{
60-
id:"infinite",
61-
label:"The 'infinite' error",
62-
desc:"The expression can match 0 characters, and therefore matches infinitely.",
63-
ext:" <h1>Example:</h1><code>.*</code> can match <code>0</code> characters, and therefore will match infinitely."
64-
},
65-
{
66-
id:"timeout",
67-
label:"The 'timeout' error",
68-
desc:"The expression took longer than 250ms to execute.<br><span class='small-text'><hr>** Certain patterns can cause exponential growth, and may timeout.</span>",
69-
ext:" <h1>Example:</h1> Using <code>^(a+)+$</code> to match <code>aaaaaaaaaaaaaaaaaaaaaaaaaaaaB</code> will match each 'a' an indeterminate number of times, and therefore will eventually timeout."
7070
}
7171
]
7272
},

0 commit comments

Comments
 (0)