This package provides Perl-Compatible RegularExpression
support in Go using libpcre
or libpcre++
.
Use godoc.
-
install
libpcre3-dev
orlibpcre++-dev
-
go get
sudo apt-get install libpcre3-dev
go get github.com/GRbit/go-pcre/
Go programs that depend on this package should import this package as follows to allow automatic downloading:
import (
"github.com/GRbit/go-pcre/"
)
Since this package use cgo
it will build dynamically linked.
If you plan to use this everywhere without libpcre
dependency,
you should build it statically linked. You can build your software
with the following options:
go build -ldflags="-extldflags=-static"
More details on this here
https://zherczeg.github.io/sljit/regex_perf.html
This is a fork of go-pcre which is fork of golang-pkg-pcre. The original package hasn't been updated for several years. But it is still being used in some software, despite its lack of JIT compiling, which gives huge speed-up to regexps. If you somehow can send a message to the original project owner, please inform him about this situation. Maybe he would like to transfer control over the repository to a maintainer who will have time to review pull requests.