metacpan / metacpan-grep-front-end

Grep Front end code
GNU General Public License v3.0
13 stars 12 forks source link

regex matching appears to not work. #2

Closed kentfredric closed 7 years ago

kentfredric commented 7 years ago

The first things I tried included whitespace matches and character classes:

sub\s returns no matches: https://grep.metacpan.org/search?size=20&q=sub\s&qd=&qft= do\s returns no matches: https://grep.metacpan.org/search?q=do\s&qd=&qft= [s][u][b] returns no matches: https://grep.metacpan.org/search?q=[s][u][b]&qd=&qft= [ ] returns (a character set including only space) no matches: https://grep.metacpan.org/search?q=[+]&qd=&qft=

atoomic commented 7 years ago

interesting... I can clearly reproduce the issue in production... working as expected on my sandbox wonder if it s not coming from the git version, going to try to use the system one

Grinnz commented 7 years ago

Also for the sake of clarity, it would be a good idea to label the search as PCRE regex, as git does not use Perl regex.

toddr commented 7 years ago

Also for the sake of clarity, it would be a good idea to label the search as PCRE regex, as git does not use Perl regex.

@Grinnz the interesting thing about that is that the git grep command line option is actually: "--perl-regexp"

Grinnz commented 7 years ago

Yes, but it is mislabeled. The man page specifies that it is linking to libpcre.

atoomic commented 7 years ago
/usr/bin/git grep -l -P 'sub\s' -- distros/
fatal: cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE
atoomic commented 7 years ago

git was not compiled with lib-pcre on the server, need to recompile it with pure among other dependencies, looks ok now in production

toddr commented 7 years ago

git build process for 2.13.3:


USE_LIBPCRE=YesPlease NO_TCLTK=1 ./configure --prefix=/home/toddr/git --with-libpcre && make -j18 install
atoomic commented 7 years ago

For informations, after recompiling a few requires libraries, here is the command I run to recompile git in my user directory with pure support

CPPFLAGS=-I/home/atoomic/include LDFLAGS=-L/home/atoomic/lib ./configure --prefix=/home/atoomic/ --with-libpcre --without-tcltk

List of required dependencies:

and then git itself (version 2.13.3)