📌  相关文章
📜  使用正则表达式替换字符串 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:04.287000             🧑  作者: Mango

代码示例2
line = re.sub(r"""
  (?x) # Use free-spacing mode.
  <    # Match a literal '<'
  /?   # Optionally match a '/'
  \[   # Match a literal '['
  \d+  # Match one or more digits
  >    # Match a literal '>'
  """, "", line)