Exemple #1
0
 def test__search_09(self):
     gd = dict()
     m = functions_.search(r'(?P<w1>\w+) (?P<w2>\w+) (?P<w3>\w+)', ' this is text ', groupdict = gd)
     self.assertTrue(m)
     self.assertEqual(gd, {'w1' : 'this', 'w2' : 'is', 'w3' : 'text'})
Exemple #2
0
 def test__search_06(self):
     m = functions_.search(r'this is text', '  this is text  ')
     self.assertTrue(m)
     self.assertEqual(m.span(), (2,14))
Exemple #3
0
 def test__search_07(self):
     m = functions_.search(r'this is text', '  this is text  ', strip = True)
     self.assertTrue(m)
     self.assertEqual(m.span(), (0,12))
Exemple #4
0
 def test__search_04(self):
     m = functions_.search(re.compile(r'this is'), 'this is text')
     self.assertTrue(m)
     self.assertEqual(m.span(), (0,7))