Skip to content

[\s\n] regex not match correctly #982

Answered by lippfi
mon0mon asked this question in Q&A
Discussion options

You must be logged in to vote

Does my Regex have problem or IdeaVim not working correctly?

That's a tricky question. IdeaVim follows Vim documentation and aims to support the Vim regex, which is kind of unique. You should compare behavior with Vim, not some other regexes (VsCodeVim is not powered by Vim, as far as I know, it may use JS regex or something like this).
Vim's regex is different and very editor-centric. For example, there is a token for selection (\%V) which allows you to do some cool things, e.g.
'<,'>s/\\%V\\d\\+\\%V/\\=submatch(0)+line('.')-a:firstline+1/g is a mapping that I use to increment numbers inside a selection.
You should run :help [:space:] in Vim for documentation, but the shortest answer w…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mon0mon
Comment options

Answer selected by mon0mon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants