現在python3.7を使用しています
文字列として”\”を使用したいのですができません
raw文字も\も試しましたが普通に改行されてしまいます。
python
1import re 2txt="hongefungahonge" 3pattern_newline=r'(funga)' 4#raw文字もエスケープもできませんでした 5newline=r'\n' 6#newline='\\n' 7txt=re.sub(pattern_newline,newline,txt)
よろしくお願いします

回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。