User:Rongzhou/Nvim Regex: Difference between revisions

From Wikibase
Jump to navigation Jump to search
Created page with "== Markdown /md == Text > list <syntaxhighlight lang="text" copy> :%s#^#- # </syntaxhighlight>"
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Markdown /md  ==
== Markdown /md  ==


Text > list
Text <> list


<syntaxhighlight lang="text" copy>
<syntaxhighlight lang="text" copy>
:%s#^#- #
:%s#^#- #
</syntaxhighlight>
<syntaxhighlight lang="text" copy>
:%s#^- ##
</syntaxhighlight>
== Katex ==
\[ \( <> $$ $ separator change:
<syntaxhighlight lang="text" copy>
:%s/\(\\(\(.\{-}\)\\)\)\|\(\\\[\(\_.\{-}\)\\\]\)/\=submatch(1) != '' ? '$'.submatch(2).'$' : '$$'.submatch(4).'$$'/g
</syntaxhighlight>
<syntaxhighlight lang="text" copy>
:%s/\$\$\(\_.\{-}\)\$\$\|\$\(.\{-}\)\$/\=submatch(0) =~ '^\$\$' ? '\['.submatch(1).'\]' : '\('.submatch(2).'\)'/g
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 07:06, 23 September 2026

Markdown /md

Text <> list

:%s#^#- #
:%s#^- ##

Katex

\[ \( <> $$ $ separator change:

:%s/\(\\(\(.\{-}\)\\)\)\|\(\\\[\(\_.\{-}\)\\\]\)/\=submatch(1) != '' ? '$'.submatch(2).'$' : '$$'.submatch(4).'$$'/g
:%s/\$\$\(\_.\{-}\)\$\$\|\$\(.\{-}\)\$/\=submatch(0) =~ '^\$\$' ? '\['.submatch(1).'\]' : '\('.submatch(2).'\)'/g