[util.regex] A package that provides the power of regular expressions without regular expressions
<norm <at> dad.org>
2015-07-16 16:51:15 GMT
(I am sorry if this Email is improperly addressed. If it is, would somebody
tell me how to address it).
We have a package, which provides Java programmers with the power of
regular expressions without regular expressions. We would like to make the
package part of Apache Commons. Can somebody tell us what steps are involved?
>From the package's package description:
Provides the power of regular expressions without regular expressions.
Some people, when confronted with a problem, think, "I know, I'll use regular
expressions." Now they have two problems. - Jaimie Zawinski
Naomi is a package that enables Java programmers to search for and optionally
replace textual patterns in documents or strings. Simple tasks of this
sort--such as systematically changing multiple filenames or modifying text in
documents--are often performed using inline or one-shot scripts written using
tools such as awk, sed, or Perl, all of which use (somewhat different)
variants of regular expression ("RE") syntax. The standard java.util.regex
package provides its own set of RE tools for use in Java. But performing
complex searching and match-and-replace tasks or performing such tasks
repetitively with minor variations can be quite difficult using REs, and RE
syntax is inherently alien to Java's object-oriented style of programming.
Naomi offers a much more transparent way of attacking such problems that is
more compatible with Java style and much better suited to larger problems.
That is, Naomi provides the power of regular expressions without regular