Link to home
Start Free TrialLog in
Avatar of chima
chima

asked on

Regular Expressions

Hello,
I would like to know what you use for a Regular Expression tool?  I'm not asking about an editor, but some type of "expression test tool."  I can google for such app, and read;
http://www.bastian-bergerhoff.com/eclipse/features/web/QuickREx/toc.html 
http://www.bastian-bergerhoff.com/eclipse/features/web/QuickREx/standalone.html#why

Yet allow me to ask; is there a better tool, or the best tool?
SOLUTION
Avatar of user_n
user_n
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chima
chima

ASKER

user_n, really! now that's a pain.  Okay, for Python then.
Avatar of pepr
Regular expressions are the way of expressing programs that accept the tested strings. They are a kind of programs where the code (the pattern string) is compiled into the form of so called automaton. This way, one can think also of regular languages See the Noam Chomski hierarchy and the basics of formal grammars (http://en.wikipedia.org/wiki/Chomsky_hierarchy).

From that perspective, it is difficult to think about a general tool that would test your regular expression.

However, you can use the approach used for testing programs. Simply said, you can create the set of strings that will be used for testing of your regular expression. The testing function will produce the boolean result that says whether the regular expression behaves the expected way.

When the approach is used for testing the functionality of fragments of bigger code (of the functions, procedures), it is called unit testing (http://en.wikipedia.org/wiki/Unit_testing). When you define the wanted behaviour in the form of tests first, and only then you start to implement the solution, then the approach is called test-driven development (http://en.wikipedia.org/wiki/Test_driven_development).

To summarize, you may want to use the unit test framework that is available in Python as the standard module (http://docs.python.org/2/library/unittest.html).

There is the chapter in "Dive Into Python 3" explicitly focused to creating the regular expressions (http://getpython3.com/diveintopython3/regular-expressions.html), and a separate chapter is devoted to unit testing -- shown on testing the regular expressions built in the earlier chapter (http://getpython3.com/diveintopython3/unit-testing.html). The book itself is nicely written, not using big words, explaining what you need to know.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ozo: There is the data/code duality when programming. The strings expressed via regular expressions can only be accepted by some program that implements the detection, right? The implementations may differ, but should not we start from the basics? And the efficient implementation is based on a final automaton.
Avatar of chima

ASKER

pepr and ozo, while I appreciate your comments, and some good knowledge became of your comments, I feel that we got off the question.  I was/am in search of other Regular Expression tools like QuickREx, see initial links given.  My question is; are there other tools which are better than QuickREx?  Or at least one?
i did not know that Regular Expressions were not a "standard."  User_n pointed out that there are ; "Regular expresions are diferent for diferent programing languages."
I googled to learn whether QuickREx could work with Python and it can.
The purpose of this question, is to learn whether I should spend the time to study QuickREx, when in fact there is a better tool than QuickREx.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chima

ASKER

thanks for the help.