snipt

Ctrl+h for KB shortcuts

PHP

code igniter e-mail regex

1
2
3
<?php

$email_regex = "/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/";
https://snipt.net/embed/cabba05a4806bd98c99637ee62438711/
/raw/cabba05a4806bd98c99637ee62438711/
cabba05a4806bd98c99637ee62438711
php
PHP
3
2019-07-21T03:14:57
True
False
False
/api/public/snipt/30226/
code-igniter-e-mail-regex
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nv">$email_regex</span> <span class="o">=</span> <span class="s2">&quot;/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/&quot;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
e-mail, regex

ActionScript 3

e-mail validator

1
2
3
4
private function isValidEmail(email:String):Boolean {
var emailExpression:RegExp = /^[a-z][\w.-][email protected]\w[\w.-]+\.[\w.-]*[a-z][a-z]$/i;
return emailExpression.test(email);
}
https://snipt.net/embed/9da2dc41600baf7a26245f8689696b94/
/raw/9da2dc41600baf7a26245f8689696b94/
9da2dc41600baf7a26245f8689696b94
as3
ActionScript 3
4
2019-07-21T13:11:31
True
False
False
/api/public/snipt/4964/
e-mail-validator
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kd">private</span> <span class="kd">function </span><span class="nf">isValidEmail</span><span class="o">(</span><span class="n">email</span><span class="o">:</span><span class="kt">String</span><span class="o">):</span><span class="kt">Boolean</span> <span class="o">{</span> </span><span id="L-2"><a name="L-2"></a><span class="kd">var</span> <span class="n">emailExpression</span><span class="p">:</span><span class="kt">RegExp</span> <span class="o">=</span> <span class="sr">/^[a-z][\w.-][email protected]\w[\w.-]+\.[\w.-]*[a-z][a-z]$/i</span><span class="o">;</span> </span><span id="L-3"><a name="L-3"></a><span class="k">return</span> <span class="n">emailExpression</span><span class="o">.</span><span class="na">test</span><span class="o">(</span><span class="n">email</span><span class="o">);</span> </span><span id="L-4"><a name="L-4"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
e-mail, validator