CUFP
haukex
<p>I [id://1220426|recently] published a beta of [http://webperl.zero-g.net|WebPerl], and now I've written my first full web app with it: a browser-based regex tester.</p>
<p>Since WebPerl is a full build of Perl, you have the full power of core Perl at your disposal, and it runs entirely in the browser - unlike some other online regex testers, which either run <c>perl</c> on a server, or only support PCRE (Perl Compatible Regular Expressions). It should work in modern browsers like Firefox and Chrome (not tested in IE yet, it might have issues there). Try it out, and let me know what you think, and report any issues you might find. I'd also be happy to accept issues and patches [https://github.com/haukex/webperl/blob/master/web/regex_tester.html|on GitHub]. Please consider it a <b>beta</b>.</p>
<p><b>[http://webperl.zero-g.net/regex.html]</b><br/>
<small>(It may take a few seconds to load and initialize, WebPerl is currently a ~4MB download, but once it's in your cache it should be fine.)</small></p>
<p>You can even create URLs to examples, here I'll use that to show off some features:</p>
<ul>
<li>[https://webperl.zero-g.net/regex.html#flags=gi®ex=wo(.)&samp1=Hello%2C%20World!&samp2=Oh%2C%20what%20a%20wonderful%20world!&samp3=No%20match%20here&showsampcode=1|A basic example], showing the match highlighting and some generated Perl code that a user can easily copy and try out. Also try clicking the <c>use re "debug";</c> button for debug output.</li>
<li>[https://webperl.zero-g.net/regex.html#flags=i&pre=my%20%24x%20%3D%20%22wo%22%3B%0A®ex=%5CQ%24x%5CE(.)&samp1=Hello%2C%20World!&samp2=Oh%2C%20what%20a%20wonderful%20world!&samp3=No%20match%20here&showsampcode=1|With "preamble code"], some Perl code that gets run before the regex.</li>
<li>[https://webperl.zero-g.net/regex.html#flags=mig®ex=%5E(%3F%3Ahello%7Chi%7Chowdy)%5Cb&samp1=Trying%20to%20match%20greetings%20at%20the%20beginning%20of%20lines%0AHello%2C%20World!%0AHill%20shouldn't%20match%0AHi%2C%20how%20are%20you%3F%0AHowever%2C%20this%20should%20match%20too%0AHowdy!|Multi-line input strings] work too</li>
<li>[https://webperl.zero-g.net/regex.html#flags=msxgc®ex=%5CG%20%5Cs*%20%5Cb%0A(%3F%3Cname%3E%20%5Cw%2B%20)%20%3D%20%5Cs*%0A(%3F%3Cvalue%3E%20-%3F%20(%3F%3A%5Cd*%5C.)%3F%20%5Cd%2B%20)%0A(%3F%3A%20%5Cs*%20%20%23%20unit%20is%20optional%0A%20%20%20%20%23%20a%20unit%20should%20not%20look%20like%20a%20new%20value%0A%20%20%20%20(%3F%3Cunit%3E%20(%3F!%20%5Cw%2B%20%3D%20%5Cs*%20%5B%5C-%5Cd%5C.%5D%20)%20%5B%5E%5Cs%2C%5D%2B%20)%0A)%3F%0A%5Cb%20%5Cs*&samp1=RH%3D%2048.2%20%25RH%20T%3D%2024.6%20'C%20Td%3D%2012.9%20'C%20Tdf%3D%2012.9%20'C%20a%3D%2010.9%20g%2Fm3%20%20%20x%3D%20%20%209.3%20g%2Fkg%20%20Tw%3D%2017.3%20'C%20ppm%3D%2014944%20pw%3D%20%2014.92%20hPa%20pws%3D%20%2030.92%20hPa%20h%3D%20%2048.5%20kJ%2Fkg&samp2=RH%3D%2045.5%20%25RH%20T%3D%2025.5%20'C%20Td%3D%2012.9%20'C%20Tdf%3D%2012.9%20'C%20a%3D%2010.8%20g%2Fm3%20%20%20x%3D%20%20%209.2%20g%2Fkg%20%20Tw%3D%2017.6%20'C%20ppm%3D%2014859%20pw%3D%20%2014.84%20hPa%20pws%3D%20%2032.59%20hPa%20h%3D%20%2049.3%20kJ%2Fkg&samp3=RH%3D%2035.2%20%25RH%20T%3D%2027.5%20'C%20Td%3D%2010.7%20'C%20Tdf%3D%2010.7%20'C%20a%3D%20%209.3%20g%2Fm3%20%20%20x%3D%20%20%208.0%20g%2Fkg%20%20Tw%3D%2017.3%20'C%20ppm%3D%2012882%20pw%3D%20%2012.89%20hPa%20pws%3D%20%2036.63%20hPa%20h%3D%20%2048.2%20kJ%2Fkg|A somewhat more complex multi-line regex] with some real-life data from one of my data-processing scripts.</li>
<li>And finally, some lookaround wackyness: [https://webperl.zero-g.net/regex.html#flags=sg®ex=(.)(%3F!((%3F%3C%3D(%3F!%5C1).(%3F%3D(%3F2)).%7C(%3F%3D%5C1)..))%7C.*%5C1)&samp1=matching%20character%20which%20happens%20exactly%20once&samp2=The%20quick%20brown%20fox%20jumped%20over%20the%20lazy%20dog.&samp3=Pack%20my%20box%20with%20five%20dozen%20liquor%20jugs&samp4=Cwm%20fjord%20bank%20glyphs%20vext%20quiz|matching characters which happen exactly once] (from [id://1201795|here], thanks [LanX]; [id://1201976|see also])</li>
</ul>