<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Autarchy of the Private Cave &#187; regular expression</title> <atom:link href="https://bogdan.org.ua/tags/regular-expression/feed" rel="self" type="application/rss+xml" /><link>https://bogdan.org.ua</link> <description>Tiny bits of bioinformatics, [web-]programming etc</description> <lastBuildDate>Wed, 28 Dec 2022 16:09:04 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=3.8.27</generator> <item><title>Convenient design and debugging of regular expressions under Linux</title><link>https://bogdan.org.ua/2009/10/10/convenient-design-and-debugging-of-regular-expressions-under-linux-tools-comparison.html</link> <comments>https://bogdan.org.ua/2009/10/10/convenient-design-and-debugging-of-regular-expressions-under-linux-tools-comparison.html#comments</comments> <pubDate>Sat, 10 Oct 2009 15:51:18 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[debugging]]></category> <category><![CDATA[kodos]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[RE]]></category> <category><![CDATA[redet]]></category> <category><![CDATA[regexp]]></category> <category><![CDATA[regular expression]]></category> <category><![CDATA[txt2regexp]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=890</guid> <description><![CDATA[Regular expressions (regexps) are powerful indeed. But debugging non-trivial regexps is a burden even if you understand how regexps work, and remember most (if not all) regexp syntax. Miscellaneous tools exist to ease this task. This post was inspired by redet&#8217;s comparison of regexp helper tools &#8211; it could be sufficient to read only that, [&#8230;]]]></description> <content:encoded><![CDATA[<p><a
href="http://bogdan.org.ua/wp-content/uploads/2009/10/redet-supported-languages.png"><img
src="http://bogdan.org.ua/wp-content/uploads/2009/10/redet-supported-languages-199x171.png" alt="redet-supported languages" title="redet-supported languages" width="199" height="171" class="alignleft size-thumbnail wp-image-896" /></a>Regular expressions (regexps) are powerful indeed. But debugging non-trivial regexps is a burden even if you understand how regexps work, and remember most (if not all) regexp syntax.</p><p>Miscellaneous tools exist to ease this task. This post was inspired by <a
href="http://billposer.org/Software/redet.html#comparison">redet&#8217;s comparison of regexp helper tools</a> &#8211; it could be sufficient to read only that, if you&#8217;re going to try the mentioned tools yourself. Otherwise, read on.<br
/> <span
id="more-890"></span><br
/> <a
href="http://kodos.sourceforge.net/">Kodos</a> is an easy-to-use (but powerful enough) Python tool to verify regular expressions against sample user-provided strings. Available for both Linux and Windows. Generates ready-to-use Python regexp code.</p><p><a
href="http://billposer.org/Software/redet.html">redet</a> <a
href="http://billposer.org/Software/redet.html#comparison">assumes some knowledge</a> of REs. Unlike all the other helper tools, it has the widest code generation coverage &#8211; just go to &#8220;Tools->Save command information&#8221; to generate code (Python, Perl, C, grep &#8211; just to name a few of the <strong>57 (!)</strong> languages/tools/editors supported). At the same time, redet does not depend on specific versions of all supported RE engines &#8211; instead, redet automatically tests for features in available versions.</p><p><a
href="http://laurent.riesterer.free.fr/regexp/">visual-regexp</a> is similar to kodos in features.</p><p><a
href="http://txt2regex.sourceforge.net/">txt2regex</a> is a regex wizard written in bash, capable of generating code for <strong>24</strong> languages/editors/programs (by default, these are enabled: perl, php, postgres, python, sed and vim). It is really simple and convenient, though some understanding of &#8220;groups&#8221; and &#8220;character ranges&#8221; is highly recommended.</p><p><a
href="http://websvn.kde.org/trunk/playground/utils/kregexpeditor/" class="broken_link" rel="nofollow">KRegExpEditor</a> was a part of kde3-utils, and seems to be missing from current KDE 4.3. It is similar to kodos and visual-regexp in its philosophy and features.</p><p>I would recommend using one of kodos/visual-regexp/kregexpeditor to quickly test or design your regular expression, then use redet to generate appropriate source code. As an alternative (and when working in a console), just use txt2regexp to generate the code you need.</p><p>Tools I haven&#8217;t tried include <a
href="http://www.weitz.de/regex-coach/">regex coach</a> and <a
href="http://freshmeat.net/projects/regexpviewer/">regexpviewer</a>.</p><p>Please also see this extensive <a
href="http://billposer.org/Linguistics/Computation/Resources.html#patterns">list of regular expression and pattern-matching related</a> software.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F10%2Fconvenient-design-and-debugging-of-regular-expressions-under-linux-tools-comparison.html&amp;linkname=Convenient%20design%20and%20debugging%20of%20regular%20expressions%20under%20Linux" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F10%2Fconvenient-design-and-debugging-of-regular-expressions-under-linux-tools-comparison.html&amp;linkname=Convenient%20design%20and%20debugging%20of%20regular%20expressions%20under%20Linux" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F10%2Fconvenient-design-and-debugging-of-regular-expressions-under-linux-tools-comparison.html&amp;linkname=Convenient%20design%20and%20debugging%20of%20regular%20expressions%20under%20Linux" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F10%2Fconvenient-design-and-debugging-of-regular-expressions-under-linux-tools-comparison.html&amp;linkname=Convenient%20design%20and%20debugging%20of%20regular%20expressions%20under%20Linux" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F10%2Fconvenient-design-and-debugging-of-regular-expressions-under-linux-tools-comparison.html&amp;linkname=Convenient%20design%20and%20debugging%20of%20regular%20expressions%20under%20Linux" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F10%2Fconvenient-design-and-debugging-of-regular-expressions-under-linux-tools-comparison.html&#038;title=Convenient%20design%20and%20debugging%20of%20regular%20expressions%20under%20Linux" data-a2a-url="https://bogdan.org.ua/2009/10/10/convenient-design-and-debugging-of-regular-expressions-under-linux-tools-comparison.html" data-a2a-title="Convenient design and debugging of regular expressions under Linux"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2009/10/10/convenient-design-and-debugging-of-regular-expressions-under-linux-tools-comparison.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>