Quantcast
Channel: How to do case insensitive search in Vim - Stack Overflow
Viewing all articles
Browse latest Browse all 17

Answer by DevWL for How to do case insensitive search in Vim

$
0
0

Note it is a difference where you place modifiers such as "\c" in your expresion:

You can use the \c escape sequence anywhere in the pattern

Regardless from the accepted answers, which states that it is no difference of where to place modyfier in a regex pattern, its looks like it actually does matter.

example text:

asdasdasdasdasd wiktor asdasdasdasd   adasdasdasd wiktor asdasda ahjkjlkhjklasdasd asd asdasdasdasd iuuuu -       asdjkkkkkkkaopbsdasda                 wiktor ----(---------------------)--  

Match

\c^.*A?.*$
^\c.*A?.*$
^.*\cA?.*$
^.*A\c?.*$

will output:enter image description here

No match

^.\c*A?.*$
^.*A?\c.*$
^.*A?.\c*$
^.*A?.*$\c

will output:enter image description hereenter image description here

  • vim -version VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun 1 2020 06:42:35)Included patches: 1-869

Viewing all articles
Browse latest Browse all 17

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>