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

  • Home
  • SEARCH
  • 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 3872276
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:54:29+00:00 2026-05-19T21:54:29+00:00

I know for searching a whole word I should use /\<mypattern\> . But this

  • 0

I know for searching a whole word I should use /\<mypattern\>. But this is not true for dash (+U002d) character and /\<-\> always fails. I also try /\<\%d45\> and it fails too. anyone know the reason?

Edit2: As @bobbogo mentioned dash is not in ‘iskeyword’ so I add :set isk+=- and /\<-\> works!

Edit1: I think in Vim /\<word\> only is valid for alphanumeric characters and we shouldn’t use it for punctuation characters (see Edit2). I should change my question and ask how we can search punctuation character as a whole world for example I want my search found the question mark in “a ? b” and patterns like “??” and “abc?” shouldn’t be valid.

  • 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-05-19T21:54:30+00:00Added an answer on May 19, 2026 at 9:54 pm

    \< matches the zero-width boundary between a non-word character and a word character. What is a word character? It’s specified by the isk option (:help isk).

    Since - is not in your isk option, then - can never start a word, thus \<- will never match.

    I don’t know what you want, but /\>-\< will match the dash in hello-word.

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

Sidebar

Related Questions

I know this question can be answered by searching in google. But I have
I know dbsight allows synonyms and stop words for searching but does this take
I know this is a really basic question but I've been searching the internet
Ok, I know this has been asked before but after searching I couldn't find
I know this is a popular topic, but I've been searching quite a bit
I found this library and liked it. Know i am searching info how to
Ok, so I tried searching around first but I didn't exactly know how to
Sorry, I know this is probably a duplicate but having searched for 'python regular
I've been searching for a lightbox type solution that allows this but haven't found
I've tried searching for this a few times, but I just think I don't

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.