예제 #1
0
파일: xparser.py 프로젝트: daleathan/crocs
    def times2(self, regex, lbr, min, comma, rbr):
        min = ''.join((ind.val() for ind in min))

        repeat = Repeat(regex.val(), int(min))
        return repeat

        return repeat
예제 #2
0
파일: xparser.py 프로젝트: iogf/crocs
    def times13(self, regex, lbr, num, rbr, question):
        repeat = Repeat(regex.val(),
                        min=int(num.val()),
                        max=int(num.val()),
                        greedy=True)

        return repeat
예제 #3
0
파일: xparser.py 프로젝트: daleathan/crocs
 def times12(self, regex, lbr, comma, max, rbr, question):
     repeat = Repeat(regex.val(), max=int(max.val()), greedy=True)
     return repeat
예제 #4
0
파일: xparser.py 프로젝트: daleathan/crocs
 def times11(self, regex, lbr, min, comma, rbr, question):
     repeat = Repeat(regex.val(), int(min.val()), greedy=True)
     return repeat
예제 #5
0
파일: xparser.py 프로젝트: daleathan/crocs
    def times3(self, regex, lbr, comma, max, rbr):
        max = ''.join((ind.val() for ind in max))

        repeat = Repeat(regex.val(), max=int(max))
        return repeat
예제 #6
0
파일: xparser.py 프로젝트: daleathan/crocs
 def times1(self, regex, lbr, num, rbr):
     num = ''.join((ind.val() for ind in num))
     num = int(num)
     repeat = Repeat(regex.val(), num, num)
     return repeat
예제 #7
0
from crocs.regex import Seq, Include, Repeat, Pattern, NamedGroup, Include

# First we define how our Patterns look like.
name_letters = Include(Seq('a', 'z'))

# The regex {n,m} repeatition. The name should contains more
# than 0 chars.
name = Repeat(name_letters, 1)

# Create a named group to make it available after matching.
name = NamedGroup('name', name)

# The hostname part looks like the name except
# it starts with 'python' in the beginning,
hostname = Repeat(name_letters, 1)
hostname = NamedGroup('hostname', 'python', hostname)

# The Pattern class joins the sub patterns it forms a single one.
mail = Pattern(name, '@', hostname, '.', 'br')
mail.test()
mail.hits()
예제 #8
0
from crocs.regex import Pattern, Repeat, Group

e = Pattern('a', Repeat('b'), Repeat(Group('cd')))
e.test()
e.hits()