I know there are a few questions regarding this topic, but for all of them I saw a specific regular expression to be converted from Java to JavaScript.
However, non of the answers contained some kind of an algorithm to do the conversion in a generic way. So my question is if you know about an algorithm to convert Java regular expression to JavaScript regular expression? perhaps a third-party to do so?
Motivation and background: in client side, I get list of attributes from the server to render a form. Some of the form fields contain validation patterns to be checked in server later. For usability purposes, I want to be able to present the user the validation inline (like validation of an IP address), without maintaining regular expressions both in server and client.
Cheers,