示例#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'})
示例#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))
示例#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))
示例#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))