On Fri, Jun 18, 2021 at 2:34 PM Pietro <pietro.paol...@cognitivecredit.com> wrote:
> I am trying to solve the problem of automatically translating a raft of > regexes which were originally intended for GNU sed but that I'd like to run > using GoLang, if feasible. > > I could not find any syntax options/settings for the regex package which I > am assuming is quite strict in its syntax, PCRE or GNULib have options that > can change some parts of the syntax. > See https://golang.org/pkg/regexp/#CompilePOSIX and https://github.com/google/re2/wiki/Syntax. If your sed expressions are in BRE form it's straightforward to translate them to ERE form. It would not surprise me if someone has already written a tool to translate BRE/ERE syntax to Go's RE2 syntax but I'm not aware of any such tool. -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD9bNQy1-2PNaRZYuKmRC0q7jDAYmFSW-Y396qTsXsbYcA%40mail.gmail.com.