I'd like to convert regular expression into glob
I was looking on jakarta oro But i can't find method that suits my needs. That it compiles regular expression and returns its glob equivalent
They are both Type-3 grammars, so in theory it should be possible.
I am unfortunatelly limited by using JDK5.
extglob can match a number of regex constructs (
pattern-list
is a list of alterations):There are some things that regex does that cannot be done in extglob, as far as I know, too:
Assuming all of the constructs in the regex have extglob equivalents, it would be possible to convert it to extglob form. It would be difficult, because regexes are represented by a CFG. And you're using Java, which forces you to use the evil escaped escape
\\
.Why not just use a different bash utility that supports regexes? Like this.