This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygcheck and literal plus sign


On 22/01/2014 06:58, Christopher Faylor wrote:
On Tue, Jan 21, 2014 at 05:59:16PM -0600, Steven Penny wrote:
Searching for the popular compiler produces unexpected results

    $ cygcheck -p 'g++.exe'
    Found 0 matches for g  .exe

    $ cygcheck -p 'g\+\+.exe'
    Found 0 matches for g\ \ .exe

How can I include a literal '+' (plus character) in my search?

By remembering that this is a regex search.  How do you quote special characters
in regexes?  Answer: With a '\'.


I am surely dumb, but whatever and how many '\' are used
the '+' is always returned as a ' ' in the reply.

So the specific example will be appreciated,
as a single quoting usually works in regexes

 $ cd /etc/setup
 $ zcat gcc-g++.lst.gz |grep -P "g\+\+"
usr/bin/g++.exe
usr/bin/i686-pc-cygwin-g++.exe
usr/share/man/man1/g++.1.gz

Is something "sanitizing" the query on server side to avoid
nasty surprise ?

 $ zcat gcc-g++.lst.gz |grep  -P "g++" |wc -l
723


Marco



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]