我需要一些关于声明正则表达式的帮助.我的输入如下:
this is a paragraph with<[1> in between</[1> and then there are cases ... where the<[99> number ranges from 1-100</[99>.
and there are many other lines in the txt files
with<[3> such tags </[3>
Run Code Online (Sandbox Code Playgroud)
所需的输出是:
this is a paragraph with in between and then there are cases ... where the number ranges from 1-100.
and there are many other lines in the txt files
with such tags
Run Code Online (Sandbox Code Playgroud)
我试过这个:
#!/usr/bin/python
import os, sys, re, glob
for infile in glob.glob(os.path.join(os.getcwd(), '*.txt')):
for …Run Code Online (Sandbox Code Playgroud)