Example #1
0
def test(TestString, NumbersF=False):
    print
    print "expression = \"" + TestString + "\""
    stream = StringIO.StringIO(TestString)
    try:
        result = snap_character_set_expression(stream, {})
        if NumbersF == False:
            print "result     = " + result.get_number_set().get_utf8_string()
        else:
            print "result     = " + repr(result)
    except exception.RegularExpressionException, x:
        print x.message
Example #2
0
def test(TestString, NumbersF=False):
    print
    print "expression = \"" + TestString + "\""
    stream = StringIO.StringIO(TestString)
    try:
        result = snap_character_set_expression(stream, {})
        if NumbersF == False:
            print "result     = " + result.get_number_set().get_utf8_string() 
        else:
            print "result     = " + repr(result) 
    except exception.RegularExpressionException, x:
        print x.message
Example #3
0
def test(TestString, NumbersF=False):
    print
    print "expression = \"" + TestString + "\""
    stream = StringIO.StringIO(TestString)
    try:
        # if True:
        result = snap_character_set_expression(stream, {})
        result = result.get_number_set()
        if NumbersF == False:
            if result.__class__.__name__ == "DFA":
                print "result     = " + result.get_string(NormalizeF=True)
            else:
                print "result     = " + result.get_utf8_string()
        else:
            if result.__class__.__name__ == "DFA":
                print "result     = " + result.get_string(NormalizeF=True)
            else:
                print "result     = " + result.get_string()
    except exception.RegularExpressionException, x:
        print x.message
Example #4
0
def test(TestString, NumbersF=False):
    print
    print "expression = \"" + TestString + "\""
    stream = StringIO.StringIO(TestString)
    try:
    # if True:
        result = snap_character_set_expression(stream, {})
        result = result.get_number_set()
        if NumbersF == False:
            if result.__class__.__name__ == "StateMachine":
                print "result     = " + result.get_string(NormalizeF=True) 
            else:
                print "result     = " + result.get_utf8_string() 
        else:
            if result.__class__.__name__ == "StateMachine":
                print "result     = " + result.get_string(NormalizeF=True) 
            else:
                print "result     = " + result.get_string()
    except exception.RegularExpressionException, x:
        print x.message
Example #5
0
def test2(TestString):
    stream = StringIO.StringIO(TestString)
    result = snap_character_set_expression(stream, {})

    print "expression = \"" + TestString + "\""
    print "result     = " + result.get_string(Option="hex", NormalizeF=True)
Example #6
0
def test2(TestString):
    stream = StringIO.StringIO(TestString)
    result = snap_character_set_expression(stream, {})

    print "expression = \"" + TestString + "\""
    print "result     = " + result.get_string(Option="hex", NormalizeF=True)