Skip to main content
Fix typo in title.
Link
Ingo Karkat
  • 12.2k
  • 2
  • 36
  • 48

Seach Search in vim for string starting and ending with a pattern

added 61 characters in body
Source Link
Milind Dumbare
  • 886
  • 1
  • 5
  • 12

Let's say I want to highlight/search all the lines in vima file opened with vim with following criteria.

Criteria: Lines which start with "start123" and end with "321end"

 . There could be anything between these two patterns.

I tried following but no luck.

/^start123\&321end$

Ofcourse I can do this on bash with grep -G '^start123' teest|grep -G '321end$' But I want to highlight this strings in vim. Just wondering.

Let's say I want to highlight/search all the lines in vim which start with "start123" and end with "321end"

  There could be anything between these two patterns.

I tried following but no luck.

/^start123\&321end$

Ofcourse I can do this on bash with grep -G '^start123' teest|grep -G '321end$' But I want to highlight this strings in vim. Just wondering.

Let's say I want to highlight/search all the lines in a file opened with vim with following criteria.

Criteria: Lines which start with "start123" and end with "321end". There could be anything between these two patterns.

I tried following but no luck.

/^start123\&321end$

Ofcourse I can do this on bash with grep -G '^start123' teest|grep -G '321end$' But I want to highlight this strings in vim. Just wondering.

added 148 characters in body
Source Link
Milind Dumbare
  • 886
  • 1
  • 5
  • 12

Let's say I want to highlight/search all the lines in vim which start with "start123" and end with "321end"

There could be anything between these two patterns.

I tried following but no luck.

/^start123\&321end$

Ofcourse I can do this on bash with grep -G '^start123' teest|grep -G '321end$' But I want to highlight this strings in vim. Just wondering.

Let's say I want to highlight/search all the lines in vim which start with "start123" and end with "321end"

There could be anything between these two patterns.

I tried following but no luck.

/^start123\&321end$

Let's say I want to highlight/search all the lines in vim which start with "start123" and end with "321end"

There could be anything between these two patterns.

I tried following but no luck.

/^start123\&321end$

Ofcourse I can do this on bash with grep -G '^start123' teest|grep -G '321end$' But I want to highlight this strings in vim. Just wondering.

Source Link
Milind Dumbare
  • 886
  • 1
  • 5
  • 12
Loading