MultiMarkdownドキュメントをHTMLで方程式を表示できるPandocマークダウンドキュメントに変換するために、\\[
または\\]
に変換できるスクリプトを作成しようとしています。$$
私はPythonを使用して、これらの文字のすべてのインスタンスを使用して検索しています
matchstring=r'\\['
re.sub(matchstring,'$$',content)
ただし、次のエラーが発生します。
unexpected end of regular expression:line 15:matchstring=re.compile(r'\\[')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 190:
return _compile(pattern, flags)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 245:
raise error, v # invalid expression
おそらく[
私がそこにいる最後のせいです。誰かがこれを回避する方法を知っていますか?