Example #1
0
 def test_group_exactly(self):
     assert Regene("a(bc){2}").simple() == "abcbc"
Example #2
0
 def test_group_value_or_more(self):
     assert Regene("(abc){3,}").simple() == "abcabcabc"
Example #3
0
 def test_value_or_less(self):
     assert Regene("[a]").simple() == "a"
Example #4
0
 def test_plus(self):
     assert Regene("ab+").simple() == "ab"
Example #5
0
 def test_between(self):
     assert Regene("[b-z]{4,5}a").simple() == "bbbba"
Example #6
0
 def test_value_or_more(self):
     assert Regene("a[b]{1,}").simple() == "ab"
Example #7
0
 def test_quantifier_in_middle_of_string(self):
     assert Regene("ab{2}c").simple() == "abbc"
Example #8
0
 def test_question_mark(self):
     assert Regene("[ab]?").simple() == ""
Example #9
0
 def test_multiple_quantifiers(self):
     assert Regene("(ab)+(cd)+").simple() == "abcd"
Example #10
0
 def test_different_kinds_of_quantifiers_in_one_expression(self):
     assert Regene("ab?cd+c+").simple() == "acdc"
Example #11
0
 def test_exactly(self):
     assert Regene("abc{2}").simple() == "abcc"
Example #12
0
 def test_between(self):
     assert Regene("a{4,5}b").simple() == "aaaab"
Example #13
0
 def test_star(self):
     assert Regene("ab*c").simple() == "ac"
Example #14
0
 def test_group_value_or_less(self):
     assert Regene("a(b){,6}").simple() == "a"
Example #15
0
 def test_group_plus(self):
     assert Regene("(ab)+").simple() == "ab"
Example #16
0
 def test_plus(self):
     assert Regene("[ab]+").simple() == "a"
Example #17
0
 def test_group_question_mark(self):
     assert Regene("(ab)?").simple() == ""
Example #18
0
 def test_star(self):
     assert Regene("[ab]*c").simple() == "c"
Example #19
0
 def test_group_star(self):
     assert Regene("(ab)*c").simple() == "c"
Example #20
0
 def test_exactly(self):
     assert Regene("[abc]{2}").simple() == "aa"
Example #21
0
 def test_group_between(self):
     assert Regene("(ab){4,5}").simple() == "abababab"
Example #22
0
 def test_multiple_characters(self):
     assert Regene("abc").simple() == "abc"
Example #23
0
 def test_single_character(self):
     assert Regene("a").simple() == "a"
Example #24
0
 def test_set_in_start_of_string(self):
     assert Regene("[a]bcc").simple() == "abcc"
Example #25
0
 def test_empty_string(self):
     assert Regene("").simple() == ""