1
noqwerty 2017 年 5 月 3 日
```python
import re x = '[ CH4 ]' regex = re.compile(r'(\[\s?[A-Z].*?)(\d)(\s?\])') print(re.sub(regex, r'\1<sub>\2</sub>\3', x)) # [ CH<sub>4</sub> ] ``` |