Package java.util.regex

Examples of java.util.regex.Matcher.group()


  private static AbstractCanvasObject createPath(Element elt) {
    Matcher patt = PATH_REGEX.matcher(elt.getAttribute("d"));
    List<String> tokens = new ArrayList<String>();
    int type = -1; // -1 error, 0 start, 1 curve, 2 polyline
    while (patt.find()) {
      String token = patt.group();
      tokens.add(token);
      if (Character.isLetter(token.charAt(0))) {
        switch (token.charAt(0)) {
        case 'M':
          if (type == -1) type = 0;
View Full Code Here


        String text = sb.substring(txtStart, txtEnd);
        ret.add(new TextComponent(text, currentFont, currentColor));
      }
      txtStart = txtEnd;

      String fontFace = m.group(3);
      String fontSize = m.group(4);
      String colorCodeStr = m.group(7);
      String colorStr = m.group(9);

      if(fontFace != null)
View Full Code Here

        ret.add(new TextComponent(text, currentFont, currentColor));
      }
      txtStart = txtEnd;

      String fontFace = m.group(3);
      String fontSize = m.group(4);
      String colorCodeStr = m.group(7);
      String colorStr = m.group(9);

      if(fontFace != null)
        currentFont = new Font(fontFace, currentFontStyle, currentFontSize);
View Full Code Here

      }
      txtStart = txtEnd;

      String fontFace = m.group(3);
      String fontSize = m.group(4);
      String colorCodeStr = m.group(7);
      String colorStr = m.group(9);

      if(fontFace != null)
        currentFont = new Font(fontFace, currentFontStyle, currentFontSize);
      if(fontSize != null)
View Full Code Here

      txtStart = txtEnd;

      String fontFace = m.group(3);
      String fontSize = m.group(4);
      String colorCodeStr = m.group(7);
      String colorStr = m.group(9);

      if(fontFace != null)
        currentFont = new Font(fontFace, currentFontStyle, currentFontSize);
      if(fontSize != null)
      {
View Full Code Here

            parentFile.mkdirs();
            Pattern p = Pattern.compile("class ([a-zA-Z0-9]+)");
            for (String model : models) {
                Matcher m = p.matcher(model);
                if (m.find()) {
                    String className = m.group().substring("class".length()).trim();
                    File classFile = new File(parentFile, className + ".java");
                    Writer o = new FileWriter(classFile, false);
                    PrintWriter writer = new PrintWriter(new BufferedWriter(o));
                    writer.write(model);
                    writer.close();
View Full Code Here

    Pattern p = Pattern.compile("Version:.*git(\\d{8}).*");
    Matcher match = p.matcher(version);

    if (match.find()) {
      if (Integer.parseInt(match.group(1)) >= WEBIF_MINIMUM_VERSION) {
        return true;
      }
    }

    return false;
View Full Code Here

   */
  private void gatherChannels(StringBuffer webPage, TopfieldServiceType type) {
    ArrayList<SatelliteInfo> satellites = new ArrayList<SatelliteInfo>();
    Matcher infoMatcher = Pattern.compile(String.format(INFO_CREATE_FORMAT, type)).matcher(webPage);
    while (infoMatcher.find()) {
      satellites.add(new SatelliteInfo(Integer.parseInt(infoMatcher.group(1)), Integer.parseInt(infoMatcher.group(2)),
          infoMatcher.group(4)));
    }
    for (SatelliteInfo info : satellites) {
      Matcher channelMatcher = Pattern.compile(String.format(INFO_CHANNEL_FORMAT, type, info.getIndex())).matcher(
          webPage);
View Full Code Here

   */
  private void gatherChannels(StringBuffer webPage, TopfieldServiceType type) {
    ArrayList<SatelliteInfo> satellites = new ArrayList<SatelliteInfo>();
    Matcher infoMatcher = Pattern.compile(String.format(INFO_CREATE_FORMAT, type)).matcher(webPage);
    while (infoMatcher.find()) {
      satellites.add(new SatelliteInfo(Integer.parseInt(infoMatcher.group(1)), Integer.parseInt(infoMatcher.group(2)),
          infoMatcher.group(4)));
    }
    for (SatelliteInfo info : satellites) {
      Matcher channelMatcher = Pattern.compile(String.format(INFO_CHANNEL_FORMAT, type, info.getIndex())).matcher(
          webPage);
View Full Code Here

  private void gatherChannels(StringBuffer webPage, TopfieldServiceType type) {
    ArrayList<SatelliteInfo> satellites = new ArrayList<SatelliteInfo>();
    Matcher infoMatcher = Pattern.compile(String.format(INFO_CREATE_FORMAT, type)).matcher(webPage);
    while (infoMatcher.find()) {
      satellites.add(new SatelliteInfo(Integer.parseInt(infoMatcher.group(1)), Integer.parseInt(infoMatcher.group(2)),
          infoMatcher.group(4)));
    }
    for (SatelliteInfo info : satellites) {
      Matcher channelMatcher = Pattern.compile(String.format(INFO_CHANNEL_FORMAT, type, info.getIndex())).matcher(
          webPage);
      while (channelMatcher.find()) {
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.