Codota Logo
RE$Match
Code IndexAdd Codota to your IDE (free)

How to use
RE$Match
in
juzu.impl.router.regex

Best Java code snippets using juzu.impl.router.regex.RE$Match (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: org.juzu/juzu-core

 @Override
 public Match[] find(CharSequence s) {
  java.util.regex.Matcher matcher = get(s);
  if (matcher.find()) {
   Match[] matches = new Match[1 + matcher.groupCount()];
   for (int i = 0;i <= matcher.groupCount();i++) {
    if (matcher.group() != null) {
     matches[i] = new Match(matcher.start(i), matcher.end(i), matcher.group(i));
    }
    else {
     matches[i] = NULL_MATCH;
    }
   }
   return matches;
  }
  else {
   return NO_MATCHES;
  }
 }
};
origin: org.juzu/juzu-core

int nextPos = matches[0].getEnd();
Path nextPath = path.subPath(nextPos);
 for (int j = 0;j < param.matchingRegex.length;j++) {
  RE.Match match = matches[index + j];
  if (match.getEnd() != -1) {
   String value;
   if (!param.preservePath) {
    StringBuilder sb = new StringBuilder();
    for (int from = match.getStart();from < match.getEnd();from++) {
     char c = path.charAt(from);
     if (c == child.router.separatorEscape && !path.isEscaped(from)) {
    value = match.getValue();
origin: juzu/juzu

@Test
public void testSimpleGroup1() {
 RE regex = JRegexFactory.INSTANCE.compile("(abc)");
 RE.Match[] matches = regex.matcher().find("abc");
 assertEquals(2, matches.length);
 assertEquals(0, matches[0].getStart());
 assertEquals(3, matches[0].getEnd());
 assertEquals("abc", matches[0].getValue());
 assertEquals(0, matches[1].getStart());
 assertEquals(3, matches[1].getEnd());
 assertEquals("abc", matches[1].getValue());
}
origin: juzu/juzu

 @Test
 public void testNonCapturingGroup() {
  RE regex = JRegexFactory.INSTANCE.compile("a(?:b)c");
  RE.Match[] matches = regex.matcher().find("abc");
  assertEquals(1, matches.length);
  assertEquals(0, matches[0].getStart());
  assertEquals(3, matches[0].getEnd());
  assertEquals("abc", matches[0].getValue());
 }
}
origin: org.juzu/juzu-core

@Test
public void testLiteral() {
 RE regex = JRegexFactory.INSTANCE.compile("abc");
 RE.Match[] matches = regex.matcher().find("abc");
 assertEquals(1, matches.length);
 assertEquals(0, matches[0].getStart());
 assertEquals(3, matches[0].getEnd());
 assertEquals("abc", matches[0].getValue());
}
origin: org.juzu/juzu-core

@Test
public void testSimpleGroup1() {
 RE regex = JRegexFactory.INSTANCE.compile("(abc)");
 RE.Match[] matches = regex.matcher().find("abc");
 assertEquals(2, matches.length);
 assertEquals(0, matches[0].getStart());
 assertEquals(3, matches[0].getEnd());
 assertEquals("abc", matches[0].getValue());
 assertEquals(0, matches[1].getStart());
 assertEquals(3, matches[1].getEnd());
 assertEquals("abc", matches[1].getValue());
}
origin: juzu/juzu

@Test
public void testLiteral() {
 RE regex = JRegexFactory.INSTANCE.compile("abc");
 RE.Match[] matches = regex.matcher().find("abc");
 assertEquals(1, matches.length);
 assertEquals(0, matches[0].getStart());
 assertEquals(3, matches[0].getEnd());
 assertEquals("abc", matches[0].getValue());
}
origin: org.juzu/juzu-core

 @Test
 public void testNonCapturingGroup() {
  RE regex = JRegexFactory.INSTANCE.compile("a(?:b)c");
  RE.Match[] matches = regex.matcher().find("abc");
  assertEquals(1, matches.length);
  assertEquals(0, matches[0].getStart());
  assertEquals(3, matches[0].getEnd());
  assertEquals("abc", matches[0].getValue());
 }
}
origin: org.juzu/juzu-core

 @Override
 public Match[] find(CharSequence s) {
  jregex.Matcher matcher = get(s);
  if (matcher.find()) {
   Match[] matches = new Match[matcher.groupCount()];
   for (int i = 0;i < matcher.groupCount();i++) {
    if (matcher.isCaptured(i)) {
     matches[i] = new Match(matcher.start(i), matcher.end(i), matcher.group(i));
    }
    else {
     matches[i] = NULL_MATCH;
    }
   }
   return matches;
  }
  else {
   return NO_MATCHES;
  }
 }
};
origin: juzu/juzu

 @Override
 public Match[] find(CharSequence s) {
  jregex.Matcher matcher = get(s);
  if (matcher.find()) {
   Match[] matches = new Match[matcher.groupCount()];
   for (int i = 0;i < matcher.groupCount();i++) {
    if (matcher.isCaptured(i)) {
     matches[i] = new Match(matcher.start(i), matcher.end(i), matcher.group(i));
    }
    else {
     matches[i] = NULL_MATCH;
    }
   }
   return matches;
  }
  else {
   return NO_MATCHES;
  }
 }
};
origin: juzu/juzu

 @Override
 public Match[] find(CharSequence s) {
  java.util.regex.Matcher matcher = get(s);
  if (matcher.find()) {
   Match[] matches = new Match[1 + matcher.groupCount()];
   for (int i = 0;i <= matcher.groupCount();i++) {
    if (matcher.group() != null) {
     matches[i] = new Match(matcher.start(i), matcher.end(i), matcher.group(i));
    }
    else {
     matches[i] = NULL_MATCH;
    }
   }
   return matches;
  }
  else {
   return NO_MATCHES;
  }
 }
};
origin: org.juzu/juzu-core

@Test
public void testSimpleGroup2() {
 RE regex = JRegexFactory.INSTANCE.compile("a(b)c");
 RE.Match[] matches = regex.matcher().find("abc");
 assertEquals(2, matches.length);
 assertEquals(0, matches[0].getStart());
 assertEquals(3, matches[0].getEnd());
 assertEquals("abc", matches[0].getValue());
 assertEquals(1, matches[1].getStart());
 assertEquals(2, matches[1].getEnd());
 assertEquals("b", matches[1].getValue());
}
origin: juzu/juzu

int nextPos = matches[0].getEnd();
Path nextPath = path.subPath(nextPos);
 for (int j = 0;j < param.matchingRegex.length;j++) {
  RE.Match match = matches[index + j];
  if (match.getEnd() != -1) {
   String value;
   if (!param.preservePath) {
    StringBuilder sb = new StringBuilder();
    for (int from = match.getStart();from < match.getEnd();from++) {
     char c = path.charAt(from);
     if (c == child.router.separatorEscape && !path.isEscaped(from)) {
    value = match.getValue();
origin: juzu/juzu

@Test
public void testSimpleGroup2() {
 RE regex = JRegexFactory.INSTANCE.compile("a(b)c");
 RE.Match[] matches = regex.matcher().find("abc");
 assertEquals(2, matches.length);
 assertEquals(0, matches[0].getStart());
 assertEquals(3, matches[0].getEnd());
 assertEquals("abc", matches[0].getValue());
 assertEquals(1, matches[1].getStart());
 assertEquals(2, matches[1].getEnd());
 assertEquals("b", matches[1].getValue());
}
juzu.impl.router.regexRE$Match

Most used methods

  • <init>
  • getEnd
  • getStart
  • getValue

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • JList (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now