-
-
Save kozo496/d7a44b2887854c8a790ba359837d79fc to your computer and use it in GitHub Desktop.
Python - re.subでタグを変換
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
# `text`中のlatexのタグ`$`を`[tex:]`変更 | |
result = re.sub(r'\$(\S+?)\$', r'[tex: \1]', text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment