Examples of CompiledAutomaton


Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.regex.CompiledAutomaton

public class TestPORegexp {
    static Random r = new Random(42L);

    @Test
    public void testOrdering() {
        CompiledAutomaton auto2 = new CompiledAutomaton("[a-z]{3}");
        assertFalse(auto2.match("1234", "abc") );
        assertTrue(auto2.match("abc", "1234") );

        auto2 = new CompiledAutomaton(".*#c");
        assertTrue(auto2.match("ab#c", "dummy"));

        auto2 = new CompiledAutomaton(".*@.*");
        assertTrue(auto2.match("ab@c", "dummy"));

        auto2 = new CompiledAutomaton("abc&def");
        assertTrue(auto2.match("abc&def", "dummy"));

        auto2 = new CompiledAutomaton("abc~[ab]");
        assertTrue(auto2.match("abc~a", "dummy"));

        CompiledRegex regex2 = new CompiledRegex(Pattern.compile("[a-z]{3}"));
        assertFalse(regex2.match("1234", "abc") );
        assertTrue(regex2.match("abc", "1234") );

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.