[please don't top-post]
hilal Adam wrote:
>
> 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.
>
> I tried your suggestion, \*\@<!\*\*\*\@!, and I get a no pattern found
> reply while I stirring at a line that has **.
Ben's suggestion should work -- at least it did for me. But you can also
try the following pattern
\(^\|[^*]\)\*\*\([^*]\|$\)
This searches for two asterisks that are preceded by either the start of
line or some character other than an asterisk and which are followed by
a non-asterisk or the end of line.
This would also include the preceding and following characters in the
match, if any. If you want to restrict the match (and thus the
highlighting) to the two asterisks, include \zs and \ze in the pattern:
\(^\|[^*]\)\zs\*\*\ze\([^*]\|$\)
Regards,
Jürgen
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment