Slide 17
Slide 17 text
Regular Expressions
Basics - Repetitions
● *, +: 0-1 or more repetitions
>>> re.findall('FO+', 'FOOOOOOOOO')
>>> re.findall('BA*R', 'BR')
● ?: 0 or 1 repetitions
>>> re.findall('colou?r', 'color')
>>> re.findall('colou?r', 'colour')
● {n}, {n,m}: N repetitions:
>>> re.findall('\d{2}', '2013-07-21')
>>> re.findall('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}','192.168.1.25')