Python Regular Expression Builder is a graphical user interface built with wxPython to access the re python module. It simplifies the creation of regular expressions.
- A text box that displays the text to be analyzed
- A text box that displays the regular expression to be applied
- A tree control that shows the results
Anytime one of the two text boxes changes, the program compiles the regular expression and applies it. In case of any errors detected in the regular expression, users can see the error message in the status bar.
Furthermore, Pyreb has a simple XMLRPC server that can be used via an external application. The server should be started using the Tools/Start XMLRPC Server menu within the application, and it recognizes four methods, namely:
- Pyreb.setText(Txt)
- Pyreb.getText()
- Pyreb.setRegex(Txt)
- Pyreb.getRegex()
The initial two methods enable users to get or set the text in the uppermost section, whereas the last two get or set the regular expression in the middle section. After this is set, the match is recalculated and displayed, just like how it happens in interactive usage.
Here's an example session to help you understand how it works:
```
>>> import xmlrpclib
>>> a = xmlrpclib.ServerProxy("")
>>> 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 will set the 'abc' text in the "Text to analyze" edit box, the regular expression in the "Regex to apply" edit box, and then compute the match, displayed inside the lower "Results" tree.
One requirement to use the tool is the use of GNU/LINUX (Mandrake distro, Kernel 2.4), Python (Official 2.4.1, ActivePython 2.4.2), wxWidgets >= 2.6.0 (2.6.1), and wxPython >= 2.6.0 (2.6.1).
The newest release has introduced a noteworthy update where the XMLRPC server can now be launched directly via the command line.
Version 0.1.6: N/A