snipt

Ctrl+h for KB shortcuts

Perl

get to_date regex for notepad++

1
2
3
4
5
6
7
#Original regex
to_date\('[0-9]{2}-[0-9]{2}-[0-9]{4}\s{1}[0-9]{2}:[0-9]{2}:[0-9]{2}',\s{1}'dd-mm-yyyy\s{1}hh24:mi:ss'\)
to_date\('[0-9]{2}-[A-Z]{3}-[0-9]{2}','DD-MON-RR'\)

# For notepad++
to_date\('[0-9]+-[0-9]+-[0-9]+\s[0-9]+:[0-9]+:[0-9]+',\s'dd-mm-yyyy\shh24:mi:ss'\)
to_date\('[0-9]+-[A-Z]+-[0-9]+','DD-MON-RR'\)
https://snipt.net/embed/a727e534c51665da0868be86107ab2a4/
/raw/a727e534c51665da0868be86107ab2a4/
a727e534c51665da0868be86107ab2a4
perl
Perl
7
2019-06-25T02:10:54
True
False
False
/api/public/snipt/14023/
get-to_date-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> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">#Original regex</span> </span><span id="L-2"><a name="L-2"></a><span class="n">to_date</span><span class="o">\</span><span class="p">(</span><span class="s">&#39;[0-9]{2}-[0-9]{2}-[0-9]{4}\s{1}[0-9]{2}:[0-9]{2}:[0-9]{2}&#39;</span><span class="p">,</span><span class="o">\</span><span class="sr">s{1}</span><span class="err">&#39;dd-mm-yyyy</span><span class="sr">\s{1}hh24:mi:ss&#39;\</span><span class="p">)</span> </span><span id="L-3"><a name="L-3"></a><span class="n">to_date</span><span class="o">\</span><span class="p">(</span><span class="s">&#39;[0-9]{2}-[A-Z]{3}-[0-9]{2}&#39;</span><span class="p">,</span><span class="s">&#39;DD-MON-RR&#39;</span><span class="o">\</span><span class="p">)</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c1"># For notepad++</span> </span><span id="L-6"><a name="L-6"></a><span class="n">to_date</span><span class="o">\</span><span class="p">(</span><span class="s">&#39;[0-9]+-[0-9]+-[0-9]+\s[0-9]+:[0-9]+:[0-9]+&#39;</span><span class="p">,</span><span class="o">\</span><span class="n">s</span><span class="s">&#39;dd-mm-yyyy\shh24:mi:ss&#39;</span><span class="o">\</span><span class="p">)</span> </span><span id="L-7"><a name="L-7"></a><span class="n">to_date</span><span class="o">\</span><span class="p">(</span><span class="s">&#39;[0-9]+-[A-Z]+-[0-9]+&#39;</span><span class="p">,</span><span class="s">&#39;DD-MON-RR&#39;</span><span class="o">\</span><span class="p">)</span> </span></pre></div> </td></tr></table>
notepad++, regex