I use a tool where a large number of strings (stored in a database) are transformed by a series of Java regex rules to be more human-readable. To make it easier to add new rules, I want a UI that shows which strings will be affected by a proposed regex.
I have a school project where one of the few requirements is that it's done with Ruby on Rails and am looking at using it to fill my above need.
Is there an existing library/gem that will convert a proposed Java-style regex to a Ruby regex (so that the code that finds affected strings can be in ruby)?
Edit: I guess I didn't explain myself very well. I'm looking for a gem that converts any given Java regex to the equivalent Ruby regex (within limits of course). Here's an example of the workflow:
- User enters the Java regex,
*[^~]Some.Regex[1-9]* - The java regex string is sent to rails server
- The rails server returns a list of the strings from the database that this regex applies to.
In looking at ways to accomplish step three, I was wondering if there is a library that will convert the java regex *[^~]Some.Regex[1-9]* to the ruby equivalent, /*[^~]Some.Regex[1-9]*/ (not sure if this is actually the equivalent, but just using it for the sake of an example).
