com.florianingerl.util.regex icon indicating copy to clipboard operation
com.florianingerl.util.regex copied to clipboard

Feature request: export regular expressions

Open Reissner opened this issue 1 year ago • 4 comments

I use this piece of software mostly in the context of latex writing a build tool in latex. But I also want to integrate with latexmk which is in perl and also with splitindex which has an implementation in Lua. So I am interested, to read in patterns in java, but export the according in other languages, most notably in perl, python and lua. It would be a great help to just create a pattern in java and then export that pattern as a pattern string as required in the various languages. If impossible to export something equivalent, an exception shall be thrown.

Reissner avatar Sep 26 '24 23:09 Reissner

This is a feature that has nothing to do with this library, but would be an additional tool, just for your specific purpose. I give programming lessons. If you want to tackle that project in a paid lesson, write an email to me @.***

On Fri, Sep 27, 2024 at 1:10 AM Ernst Reissner @.***> wrote:

I use this piece of software mostly in the context of latex writing a build tool in latex. But I also want to integrate with latexmk which is in perl and also with splitindex which has an implementation in Lua. So I am interested, to read in patterns in java, but export the according in other languages, most notably in perl, python and lua. It would be a great help to just create a pattern in java and then export that pattern as a pattern string as required in the various languages. If impossible to export something equivalent, an exception shall be thrown.

— Reply to this email directly, view it on GitHub https://github.com/florianingerl/com.florianingerl.util.regex/issues/16, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6YEWSKUEWZHWBUAK54VV3ZYSH7PAVCNFSM6AAAAABO6AL5Q2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGU2TCNRXGQ4TMNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

florianingerl avatar Sep 27 '24 03:09 florianingerl

Hm, I feel since this library has all internal structures required, it shall be easy to convert a pattern back to string. This is already implemented by toString(), but of course only returns java representation. If toString() is endowed with a parameter, one can quite easily return pattern in any language. Of course, sometimes not feasable throwning an exception.

On the other hand, a separate lib.. difficult, without exposing the internal structure of a pattern.

Reissner avatar Oct 02 '24 02:10 Reissner

Probably you know this: https://www.regular-expressions.info/

Reissner avatar Oct 02 '24 02:10 Reissner

Another thought: Frequently, there are projects with inhomogeneous technologies and also languages. Your library could be a means to bridge the technology gap in regex related aspects.

Reissner avatar Oct 02 '24 02:10 Reissner