Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion vimgrep
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ben Fritz  
View profile  
 More options Apr 5 2012, 11:30 am
From: Ben Fritz <fritzophre...@gmail.com>
Date: Thu, 5 Apr 2012 08:30:00 -0700 (PDT)
Subject: Re: vimgrep

On Wednesday, April 4, 2012 1:27:21 PM UTC-5, hilal Adam wrote:
> Ben, Thanks for your prompt response.
> Somehow I am getting 3 copies of your premature, and complete replies.

I only see one post. Weird. I'm starting to really hate the Google
Groups interface. I may try subscribing to get emails and just filter
them all away from my inbox. Ugh.

Maybe you're getting multiple copies because you're on the CC list as
well as subscribed to the mailing list? I've never had problems with
that, but I've been using the web interface for quite some time now
without getting any email I don't subscribe to directly.

> Yes. You're right \*\* was one of the approaches I used.
> Unfortunately * is treated as a metacharacter/special character/keyword
> by grep/vimgrep/c language and this where the difficulty is originating
> from.

* is not special anymore if escaped with a \.

> I tried your suggestion, \*\@<!\*\*\*\@!, and I get a no pattern
> found reply while I stirring at a line that has **.

> How would you do this in grep on cygwin command line?

I don't know about using grep from the cygwin command line. The pattern
I gave uses Vim regular expressions, so you'd need to use a :vimgrep
command to use it.

Here's the breakdown:

\*\@<! - match only where there is not a literal '*' just before
\*\* - two literal '*' characters
\*\@! - match only where there is not a literal '*' as the next
character after the match

These are both zero-width matches, meaning they are not part of the
match itself. I don't think grep from the cygwin command line supports
any such concept.

Someone else (Google Groups mangled the non-ascii characers in the name)
suggested \zs and \ze which similarly won't be supported. But if you are
using an external grep command this probably won't matter, since you can
accept matches of the character (or beginning/end of line) immediately
before/after the **. The suggested \(^\|[^*]\)\*\*\([^*]\|$\) pattern
may work in grep, possibly with some tweaking for syntax.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.