Home > other >  Regular expression matching problem
Regular expression matching problem

Time:05-20

MyStr2=r '& lt; Cite> K. 189. Cn Abcd St. 189. Cn '
The pattern=re.com running (r '& lt; Cite> * & lt;/cite> ')
PE.=the pattern match (myStr2)
If PE is None:
Print (' None ')
The else:
Print (PE) group ())

Why can't match?

CodePudding user response:

MyStr2=r '& lt; Cite> K. 189. Cn Abcd St. 189. Cn '
The pattern=re.com running (r '& lt; Cite> ([^ & lt; & gt; \/]. +?) ')
PE=pattern. The.findall (myStr2)
If PE is None:
Print (' None ')
The else:
Print (PE)
This is ok

CodePudding user response:

Help junction post + points
  • Related