Permalink
Find file
381 lines (328 sloc) 14.3 KB
<!DOCTYPE html>
<html>
<head>
<title>RegExr: Learn, Build, & Test RegEx</title>
<!-- No frames allowed -->
<script>
if(self !== top) { top.location = self.location; }
</script>
<link rel="canonical" href="http://regexr.com/">
<link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="shortcut icon" href="/assets/favicon.png" type="image/png" />
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta name=viewport content="width=device-width, initial-scale=1, user-scalable=yes">
<meta name="description" content="Regular expression tester with syntax highlighting, contextual help, video tutorial, reference, and searchable community patterns." />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<!-- Windows8 Pin to home. -->
<meta name="application-name" content="RegExr"/>
<meta name="msapplication-TileColor" content="#44A4E0"/>
<meta name="msapplication-TileImage" content="assets/windows8/mediumtile.png" />
<meta name="msapplication-square70x70logo" content="assets/windows8/smalltile.png"/>
<meta name="msapplication-square150x150logo" content="assets/windows8/mediumtile.png"/>
<meta name="msapplication-wide310x150logo" content="assets/windows8/widetile.png"/>
<meta name="msapplication-square310x310logo" content="assets/windows8/largetile.png"/>
<!-- Apple Touch icon (funnily enough also used by Android) -->
<link rel="apple-touch-icon" sizes="152x152" href="assets/apple/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="144x144" href="assets/apple/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="120x120" href="assets/apple/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="114x114" href="assets/apple/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="76x76" href="assets/apple/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="72x72" href="assets/apple/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" href="assets/apple/apple-touch-icon.png">
<!-- OG Tags for Facebook sharing -->
<meta property="og:image" content="http://regexr.com/assets/og.png"/>
<meta property="og:image:width" content="1200"/>
<meta property="og:image:height" content="630"/>
<meta property="og:title" content="RegExr: Learn, Build, & Test RegEx"/>
<meta property="og:description" content="RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp)."/>
<meta property="og:url" content="http://regexr.com/"/>
<meta property="og:site_name" content="RegExr.com"/>
<script src="js/scripts.min.js?no=<%=noCache %>"></script>
<script src="js/regExWorker.template.js?no=<%=noCache %>"></script>
<link rel="stylesheet" href="css/regexr.css?no=<%=noCache %>">
</head>
<body>
<div class="top">
<h1 class="icon regexr-logo">&#xE600;</h1><h1 class="regexr-text">RegExr</h1><span class="version regexr-text">v2.1<span class="beta-banner hidden">BETA</span></span>
<div class="links">
by <a href="http://twitter.com/gskinner/" target="_blank">gskinner</a>
<a href="./v1/" target="_blank">RegExr v1</a>
<a href="http://github.com/gskinner/regexr/" target="_blank">GitHub</a>
<a class="video-link">Tutorial</a>
</div>
</div>
<div class="lib hidden" id="libview">
<div class="title">
<span class="button noicon" data-icon="&#xE225;">Library</span>
</div>
<div class="community hidden">
<div class="search">
<span class="search-icon"></span><input type="text" class="search-input" placeholder="Search" tabindex="1" />
</div>
<div class="tag-list-container">
<div class="tag-list" tabindex="2">
<div class="renderer item"><span>{{getLabel()}}</span></div>
</div>
</div>
<div class="community-list" tabindex="3">
<div class="renderer item"><pre class="label">{{getLabel()}}</pre><div class="rating rating-list">{{getStaticRating()}}</div></div>
</div>
<!-- Template for the content. -->
<div class='community-content hidden'>
<div class="header">
<div class="favorite icon"></div>
<div class='load icon all'></div>
<div class="rating rating-content"></div>
</div>
<div class="scroll">
<pre class="description"></pre>
<p class="author"></p>
<hr/>
<div class='load icon expr'></div>
<code class="expression"></code>
<hr/>
<div class="preview-wrap">
<div class='load icon source'></div>
<code class="preview"></code>
<hr/>
</div>
<div class="tool-wrap">
<h1 class="tool-label"></h1>
<hr/>
<div class='load icon tool'></div>
<code class="tool tool-content"></code>
</div>
</div>
</div>
</div>
<div class="list" tabindex="0">
<div class="renderer item"><span class="icon">{{getIcon()}}</span>{{getLabel()}}<span class="detail">{{getDetail()}}</span></div>
</div>
<div class="content">
<b>RegExr is an online tool to <b>learn</b>, <b>build</b>, & <b>test</b> Regular Expressions (RegEx / RegExp).</b>
<hr/>
<ul>
<li>Results update in <b>real-time</b> as you type.</li>
<li><b>Roll over</b> a match or expression for details.</li>
<li><b>Save</b> & <b>share</b> expressions with others.</li>
<li>Use <b>Tools</b> to explore your results.</li>
<li>Browse the <b>Library</b> for help & examples.</li>
<li><b>Undo</b> & <b>Redo</b> with {{getCtrlKey()}}-Z / Y.</li>
<li>Search for & rate <b>Community</b> patterns.</li>
</ul>
</div>
<div id="cheatsheet">
<table class="cheatsheet">
<tr><th colspan="2" onclick="regexr.libView.show('charclasses')">Character classes</th></tr>
<tr><td>.</td><td>any character except newline</td></tr>
<tr><td>\w \d \s</td><td>word, digit, whitespace</td></tr>
<tr><td>\W \D \S</td><td>not word, digit, whitespace</td></tr>
<tr><td>[abc]</td><td>any of a, b, or c</td></tr>
<tr><td>[^abc]</td><td>not a, b, or c</td></tr>
<tr><td>[a-g]</td><td>character between a & g</td></tr>
<tr><th colspan="2" onclick="regexr.libView.show('anchors')">Anchors</th></tr>
<tr><td>^abc$</td><td>start / end of the string</td></tr>
<tr><td>\b \B</td><td>word, not-word boundary</td></tr>
<tr><th colspan="2" onclick="regexr.libView.show('escchars')">Escaped characters</th></tr>
<tr><td>\. \* \\</td><td>escaped special characters</td></tr>
<tr><td>\t \n \r</td><td>tab, linefeed, carriage return</td></tr>
<tr><td>\u00A9</td><td>unicode escaped &copy;</td></tr>
<tr><th colspan="2" onclick="regexr.libView.show('groups')">Groups & Lookaround</th></tr>
<tr><td>(abc)</td><td>capture group</td></tr>
<tr><td>\1</td><td>backreference to group #1</td></tr>
<tr><td>(?:abc)</td><td>non-capturing group</td></tr>
<tr><td>(?=abc)</td><td>positive lookahead</td></tr>
<tr><td>(?!abc)</td><td>negative lookahead</td></tr>
<tr><th colspan="2" onclick="regexr.libView.show('quants')">Quantifiers & Alternation</th></tr>
<tr><td>a* a+ a?</td><td>0 or more, 1 or more, 0 or 1</td></tr>
<tr><td>a{5} a{2,}</td><td>exactly five, two or more</td></tr>
<tr><td>a{1,3}</td><td>between one & three</td></tr>
<tr><td>a+? a{2,}?</td><td>match as few as possible</td></tr>
<tr><td>ab|cd</td><td>match ab or cd</td></tr>
</table>
</div>
</div>
<div class="doc tools-disabled" id="docview">
<div class="title expr">
Expression
<ul class="buttonbar">
<li class="button share" data-icon="&#xE309;">share</li> <!-- share: E309, new win: E152 -->
<li class="button save" data-icon="&#xE073;">save</li> <!-- file: E359, bookmark: E073-->
<li class="button flags" data-icon="&#xE267;">flags</li>
</ul>
</div>
<div class="editor expr"><div class="results"></div></div>
<div class="title source">
Text
</div>
<div class="editor source">
<div class="measure"></div>
<canvas class="canvas" width="1" height="1"></canvas>
<textarea class="default">
Welcome to RegExr v2.1 by gskinner.com, proudly hosted by Media Temple!
Edit the Expression & Text to see matches. Roll over matches or the expression for details. Undo mistakes with {{ctrl}}-z. Save Favorites & Share expressions with friends or the Community. Explore your results with Tools. A full Reference & Help is available in the Library, or watch the video Tutorial.
Sample text for testing:
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789 _+-.,!@#$%^&*();\/|&lt;>"'
12345 -98.7 3.141 .6180 9,000 +42
555.123.4567 +1-(800)-555-2468
foo@demo.net bar.ba@test.co.uk
www.demo.com http://foo.co.uk/
http://regexr.com/foo.html?q=bar
https://mediatemple.net
</textarea>
</div>
<div class="title tools">
<span>Tools</span>
<ul class="buttonbar right">
<li class="button nolabel expand" data-icon="&#xE192;" data-alticon="&#xE191;"></li>
</ul>
<ul class="buttonbar left">
<!-- If these labels are changed, also update Favorites.js -->
<li class="button replace active" data-tool="replace">Replace</li>
<li class="button list" data-tool="list">List</li>
<li class="button details" data-tool="details">Details</li>
<li class="button explain" data-tool="explain">Explain</li>
</ul>
</div>
<div class="tools editor replace"></div>
<div class="tools editor list"></div>
<div class="tools editor out"></div>
<div class="tools results"><div class="content"></div></div>
<div class="menu flags">
<header>
Expression Flags
<ul class="buttonbar">
<li class="button help" data-icon="&#xE195;"></li>
</ul></header>
<hr/>
<a class="check" data-flag="i"> ignore case <code>(i)</code></a><br/>
<a class="check" data-flag="g"> global <code>(g)</code></a><br/>
<a class="check" data-flag="m"> multiline <code>(m)</code></a><br/>
</div>
<div class="menu share">
<div id="savePrompt">
<p><a id="showSaveLink">Save</a> your pattern before sharing.</p>
</div>
<div class="share-wrap">
<header>
Share
</header>
<hr />
<div id="shareLinkView" class="share-wrap">
<input type="text" id="shareLinkTxt" readonly>
<div data-clipboard-target="#shareLinkTxt" class="icon share-link-btn">&#xE603;</div>
</div>
</div>
<header>
Expression
</header>
<hr />
<div id="shareExpressionView" class="share-wrap">
<input type="text" id="shareExpressionTxt" readonly>
<div class="icon share-expression-btn" data-clipboard-target="#shareExpressionTxt">&#xE603;</div>
</div>
<header>
Pattern
</header>
<hr />
<div id="sharePatternView" class="share-wrap">
<input type="text" id="sharePatternTxt" readonly>
<div class="icon share-pattern-btn" data-clipboard-target="#sharePatternTxt">&#xE603;</div>
</div>
<header>
Javascript
</header>
<hr />
<div id="shareJavascriptView" class="share-wrap">
<input type="text" id="shareJavascriptTxt" readonly>
<div class="icon share-javascript-btn" data-clipboard-target="#shareJavascriptTxt">&#xE603;</div>
</div>
</div>
<div class="menu save">
<header>
Save
</header>
<hr />
<div id="saveView" class="hidden">
<div class="public-wrap">
<header class="sub-header">
Add to
</header>
<hr/>
<a id="publicChk" class="check">&nbsp;Community</a><br/>
<a id="favouriteChk" class="check">&nbsp;Favourites</a><br/>
<hr/>
</div>
<div class="save-details-wrap hidden">
<label for="titleTxt">name</label> <span id="titleTxt-req">*</span><br />
<input id="titleTxt" type="text" max="30" maxlength="30" required><br />
<label for="descriptionTxt">description</label><br />
<textarea id="descriptionTxt" rows="3" max="250" maxlength="250"></textarea> <br />
<label for="tagsTxt">tags</label><br />
<input id="tagsTxt" type="text" max="50" maxlength="50"><br />
<div class="tag-list-container">
<div class="tag-list" tabindex="2">
<div class="renderer item"><span>{{getLabel()}}</span></div>
</div>
</div>
<label for="authorTxt">author</label><br />
<input id="authorTxt" type="text" max="20" maxlength="20"><br />
</div>
<input id="saveBtn" type="button" class="save-button" value="Save">
<input id="updateBtn" type="button" class="update-button" value="Update">
<div id="errorMessage" class="error-default">
<hr />
<p>There was an error saving your pattern.</p>
<p>Please try again later.</p>
</div>
</div>
<div class="success hidden">
Pattern saved. You can now <a id="showShareLink">share</a> your pattern.
</div>
<div class="no-changes hidden">
No changes since last save.
</div>
</div>
</div>
<div class="video hidden">
<!--
*******************************
*** Note the ?enablejsapi=1 ***
*******************************
It's required so we can play and pause the video.
-->
<iframe width="854" height="510" frameborder="0" allowfullscreen></iframe>
</div>
<!-- White spinner with an #242429 background. Used in the Community and Favourites header. -->
<img class="hidden spinner" src="assets/spinner.gif" inline />
<!-- White spinner used in the community search. -->
<img class="hidden spinner white" src="assets/spinnerWhite.gif" inline />
<div class="not-supported-mobile hidden">
<div class="top">
<h1 class="icon regexr-logo">&#xE600;</h1><h1 class="regexr-text">RegExr</h1><span class="version regexr-text">v2.0</span>
</div>
<div class="content">
<p>RegExr isn't optimized for mobile devices yet. You can still take a look, but it might be a bit quirky.</p>
<a id="closeOverlay"><b>&gt;</b> Okay!</a>
</div>
</div>
<div class="not-supported hidden">
<div class="top">
<h1 class="icon regexr-logo">&#xE600;</h1>
<h1 class="regexr-text">RegExr</h1><span class="version regexr-text">v2.1</span>
</div>
<div class="content">
<p>RegExr requires a modern browser. Please update your browser to the latest version and try again.</p>
<p class="flash hidden">If you have Flash support you can still visit <a href="v1/">RegExr version 1</a></p>
</div>
</div>
<!--
To fix showing the "Not supported" screen in IE 7 (and other old browsers).
Since our initial load can cause errors, we just catch them and show the overlay if they happen.
-->
<script src="js/checkSupport.template.js" inline></script>
<script src="js/analytics.template.js" inline></script>
<script src="js/index.template.js" inline></script>
</body>
</html>