Package com.firefly.utils.pattern

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


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


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

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

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

    Assert.assertThat(p.match("orange"), nullValue());
   
    p = Pattern.compile("www.?.com/?/app", "?");
    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(2));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("cn"));
   
    p = Pattern.compile("?www.?.com/?/app", "?");
    Assert.assertThat(p.match("orange"), nullValue());
    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(3));
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(2));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("cn"));
   
    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(""));
View Full Code Here

    Assert.assertThat(p.match("www.fireflysource.com/cn/app").length, is(2));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("cn"));
   
    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://"));
View Full Code Here

    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[0], is("fireflysource"));
    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("cn"));
   
    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://"));
   
View Full Code Here

    Assert.assertThat(p.match("www.fireflysource.com/cn/app")[1], is("cn"));
   
    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?", "?");
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(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());
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.