How to match two character at a time in regex?

Closed. This question needs details or clarity. It is not currently accepting answers. ---------------Answer---------------

Try this:

x = re.sub( r".*(CM).*",r"\1", txt )

Try this, re.findall(r'cm', 'abcdefghijklmnopqrstuvwxyz')

I generated it using, you can also do it if it doesn't exactly answer what you are trying to do.


Try the following:

import re
PAT = re.compile(“(?P<unit>:cm|CM)”)
x = PAT.sub(“  “, txt)

Try this :

import re
txt = "The L56MM 56x56 5.6CM rain in MM Spain C"'CM',txt).group(

Previous : MySQL: How do I SUM non duplicates values when doing multiples JOINS
Next : Javascript Is there a way that when I push data it doesn't show output the last line?