Python Regular Expression Builder 0.1.6 review

Download
by rbytes.net on

Python Regular Expression Builder is a wxPython GUI to the re python module; it will speed up the development of Python regular expre

License: GPL (GNU General Public License)
File size: 24K
Developer: Giuseppe Corbelli
0 stars award from rbytes.net

Python Regular Expression Builder is a wxPython GUI to the re python module; it will speed up the development of Python regular expression (similar to PCRE).

The GUI is simple and features 3 parts:

A text box where the text to be analyzed is displayed
A text box where the regular expression to be applied is displayed
A tree control where the results are displayed

When one of the two textboxes change the regex is compiled and applied. Errors in the regex are shown in a statusbar.

Pyreb ships with a simple XMLRPC server that can be used to control pyreb from an external application. It must be started using the

Tools/Start XMLRPC Server

menu item. The XMLRPC server understands 4 methods:

Pyreb.setText(Txt)
Pyreb.getText()
Pyreb.setRegex(Txt)
Pyreb.getRegex()

The first two get/set the text in the uppermost section; the last two get/set the regex in the medium section. Once the text/regex is set the match is recalculated and shown, as it would happen in interactive usage.

A sample session:

>>> import xmlrpclib
>>> a = xmlrpclib.ServerProxy("http://localhost:17787")
>>> a.system.listMethods()
['Pyreb.getRegex', 'Pyreb.getText', 'Pyreb.setRegex', 'Pyreb.setText', 'system.listMethods', 'system.methodHelp', 'system.methodSignature']
>>> a.Pyreb.setText("abc")
'setText'
>>> a.Pyreb.getText()
'abc'
>>> a.Pyreb.setRegex('a?(bc){1,}')
'setRegex'

These commands set the text 'abc' in the "Text to analyze" edit box, the regex in the "Regex to apply" edit box and recomputes the match, shown in the lower "Results" tree.

Requirements:
GNU/LINUX (Mandrake distro, Kernel 2.4)
Python (Official 2.4.1, ActivePython 2.4.2)
wxWidgets >= 2.6.0 (2.6.1)
wxPython >= 2.6.0 (2.6.1)

What's New in This Release:
The XMLRPC server can now be started from the command line.

Python Regular Expression Builder 0.1.6 search tags