User:Rongzhou/Nvim Regex: Difference between revisions
Jump to navigation
Jump to search
| Line 16: | Line 16: | ||
<syntaxhighlight lang="text" copy> | <syntaxhighlight lang="text" copy> | ||
:%s/\\(\(.\{-}\)\\) | :%s/\(\\(\(.\{-}\)\\)\)\|\(\\\[\(\_.\{-}\)\\\]\)/\=submatch(1) != '' ? '$'.submatch(2).'$' : '$$'.submatch(4).'$$'/g | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="text" copy> | <syntaxhighlight lang="text" copy> | ||
:%s/\$\$\(.\{-}\)\$\$ | :%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