0

I'm looking forward to search for the following pattern with Ack.vim:

.section

Where . should only match a period, and not any character.

I tried the following:

  • \.section
  • [.]section
  • -Q .section

What is the correct way of escaping the period?

jviotti
  • 17,881
  • 26
  • 89
  • 148

2 Answers2

3

From the documentation:

For instance, '#'. You have to escape it like this :Ack '\\\#define foo' to search for '#define foo'.

Use: :Ack \\\.section

Igor Pejic
  • 3,658
  • 1
  • 14
  • 32
  • If I use Vim's build in search facility, the above works, however the question is about searching with Ack.vim. – jviotti Aug 04 '14 at 18:06
1

From the documentation:

For instance, '#'. You have to escape it like this :Ack '\\\#define foo' to search for '#define foo'.

Igor Pejic
  • 3,658
  • 1
  • 14
  • 32
FLemos
  • 183
  • 1
  • 6
  • It works when using Vim's built-in search functionality, however the approaches mentioned above doesn't work with Ack for some reason. – jviotti Aug 04 '14 at 18:08