I need some help on declaring a regex. My inputs are like the following:
this is a paragraph with<[1> in between[1> and then there are cases ..
don't have to use regular expression (for your sample string)
>>> s
'this is a paragraph with<[1> in between[1> and then there are cases ... where the<[99> number ranges from 1-100[99>. \nand there are many other lines in the txt files\nwith<[3> such tags [3>\n'
>>> for w in s.split(">"):
... if "<" in w:
... print w.split("<")[0]
...
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