0
I Use This!
Activity Not Available

Project Summary

rrex - a readable regular expression library

IntroFirst the inevitable famous quote

Some people, when confronted with a problem, think
"I know, I'll use regular expressions." Now they have two problems.
--- attributed to Jamie Zawinski in 1997
(read the full history here: http://regex.info/blog/2006-09-15/247)
rrex is a Java port of Joshua Flanagan's Readable Regular Expressions C# library

See: http://flimflan.com/blog/ReadableRegularExpressions.aspx

The idea is to allow a programmer to express regular expressions in a syntax that fits within a programming language rather than use a completely different syntax.

Regular expressions are often hard to write and even harder to read especially if some time has elapsed since they were written

ExampleHere's an example of a regular expression matching social security numbers:

^\d{3}-?\d{2}-?\d{4}$In rrex it would look like this

RRex socialSecurityNumber = RRex.With().AtBeginning()
.Digit().Repeat().Exactly(3)
.Literal("-").Repeat().Optional()
.Digit().Repeat().Exactly(2)
.Literal("-").Repeat().Optional()
.Digit().Repeat().Exactly(4)
.AtEnd();Certainly wordier but I think more readable and therefore more maintanable.

You may disagree.

This is really a matter of taste, a lot of people really like regex syntax and I'm not going to argue about what is better. I just plan to use this library in a number of projects and see whether it makes working with regex's easier or harder.

license This java port is copyright 2008 by John Hardy http://www.lagado.com. This code has released under the MIT License with the permission of its original author.

Tags

java regex

In a Nutshell, rrex...

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

MIT License
Permitted

Commercial Use

Modify

Distribute

Private Use

Sub-License

Forbidden

Hold Liable

Required

Include Copyright

Include License

These details are provided for information only. No information here is legal advice and should not be used as such.

All Licenses

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    by exploring contributors within projects, you can view details on every commit they have made to that project
  • ...
    nearly 1 in 3 companies have no process for identifying, tracking, or remediating known open source vulnerabilities
  • ...
    you can embed statistics from Open Hub on your site

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

Community Rating

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!
Sample ohloh analysis