Loading ...
Sorry, an error occurred while loading the content.

67520Re: Feature request: Regex "not identifier" character class.

Expand Messages
  • ZyX
    Dec 12, 2012
    • 0 Attachment
      четверг, 13 декабря 2012 г., 0:49:13 UTC+4 пользователь So8res написал:
      > The \i and \k regex character classes are very useful, matching identifier and keyword characters respectively. You might think that \I and \K match non-(identifier,keyword) characters, but that is not what they do.
      >
      > As far as I can tell, there's no (easy) way in a regex to match non-identifier/non-keyword characters.
      >
      > I propose adding such character classes, potentially under the names \_i and \_k. I'm not entirely satisfied with those. Any other suggestions for names?
      >
      > (Alternatively, is there a way to do this that I couldn't find in the help?)

      No way for "\_i"/"\_k". "\_" already has fixed meaning: "add newline to given character class" and this change will be incompatible with current behavior.

      To match non-id/non-keyword character you should use negative look-ahead: "\v%(\i@!.)+" will match one or more non-id characters.

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 5 messages in this topic