Package com.firefly.utils.pattern

Examples of com.firefly.utils.pattern.Pattern.match()


    p = Pattern.compile("?www.?.com/?/app", "?");
    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(3));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
   
    p = Pattern.compile("?www.?.com/?/app?", "?");
    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(4));
View Full Code Here


    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(3));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
   
    p = Pattern.compile("?www.?.com/?/app?", "?");
    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(4));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
View Full Code Here

    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
   
    p = Pattern.compile("?www.?.com/?/app?", "?");
    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(4));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
View Full Code Here

    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
   
    p = Pattern.compile("?www.?.com/?/app?", "?");
    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(4));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[3], is(""));
View Full Code Here

    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
   
    p = Pattern.compile("?www.?.com/?/app?", "?");
    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(4));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[3], is(""));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app/1334")[3], is("/1334"));
View Full Code Here

   
    p = Pattern.compile("?www.?.com/?/app?", "?");
    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(4));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[3], is(""));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app/1334")[3], is("/1334"));
   
View Full Code Here

    p = Pattern.compile("?www.?.com/?/app?", "?");
    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(4));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[3], is(""));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app/1334")[3], is("/1334"));
   
    p = Pattern.compile("abc*abc", "*");
 
View Full Code Here

    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(4));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[3], is(""));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app/1334")[3], is("/1334"));
   
    p = Pattern.compile("abc*abc", "*");
    Assert.assertThat(p.match("abcabcabc")[0], is(""));
View Full Code Here

    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(4));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[3], is(""));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app/1334")[3], is("/1334"));
   
    p = Pattern.compile("abc*abc", "*");
    Assert.assertThat(p.match("abcabcabc")[0], is(""));
   
View Full Code Here

    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is(""));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[2], is("cn"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[0], is("http://"));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app")[3], is(""));
    Assert.assertThat(p.match("http://www.fireflysource.com/cn/app/1334")[3], is("/1334"));
   
    p = Pattern.compile("abc*abc", "*");
    Assert.assertThat(p.match("abcabcabc")[0], is(""));
   
    p = Pattern.compile("aa*aa", "*");
 
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.