Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7977519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:13:25+00:00 2026-06-04T09:13:25+00:00

i want to do a like search in vi. e.g. i use the command

  • 0

i want to do a like search in vi. e.g. i use the command
vi test.log
the file opens. now i want to do a forward search and i am looking for
[string1]%[string2] where % implies there can be any number of character in between these two strings (in a line). We have this kind of search in oracle(e.g. we often search for ‘pattern%’) . How to implement it in vi ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:13:27+00:00Added an answer on June 4, 2026 at 9:13 am

    If there must be at least one character between the strings:

    /string1.\+string2
    

    If there needn’t be any characters between the strings:

    /string1.*string2
    

    To use these, just start typing it; the leading / will enter Vim’s search mode. Note that you may have to escape some of the characters in string1 and string2 if they have special meaning in Vim’s regex syntax.

    Explanation:

    • . stands for any character (you can use \w if you just want to match “word” characters; i.e. letters, digits, and underscores).
    • * means “0 or more instances of the preceding pattern”.
    • \+ means “1 or more instances of the preceding pattern”.

    Vim’s regex syntax is slightly different from the standard Perl regex syntax, which is why the + quantifier needs a slash in front of it. Read more here: http://www.softpanorama.org/Editors/Vimorama/vim_regular_expressions.shtml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use the like command in a query to find specific results
How can I use grep command to search file name based on a wild
I want something like this: abcdab.search(/a/g) //return [0,4] Is it possible?
I want to develop google desktop search like application, I want to know that
I want to achieve something like the following: UrlBuilder ub = new UrlBuilder(http://www.google.com/search); ub.Parameters.Add(q,request);
I want to integrate one of image search api for finding similar image like
I want to write an SQL query using the LIKE keyword. It should search
I'm building an autosuggest search, like apple's spotlight... and want to disable the browser
I'd like to write small scripts which feature incremental search (find-as-you-type) on the command
I'd like to use the search pattern in the output part of a sed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.