Package java.util.regex

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


            matcher = pattern.matcher(line);
            if (matcher.find()) {
                // System.out.println("h: "+matcher.group(1)+"; m: "+matcher.group(2)+"; title: "+matcher.group(3)+"; short: "+matcher.group(4)+"; desc: "+matcher.group(5));
                int h = Integer.parseInt(matcher.group(1));
                int m = Integer.parseInt(matcher.group(2));
                String title = matcher.group(3);
                String shortInfo = matcher.group(4);
                String description = matcher.group(5);

                ProgramFrame frame = new ProgramFrame();
                frame.addProgramField(ProgramField.create(ProgramFieldType.START_TIME_TYPE, h * 60 + m));
View Full Code Here


            if (matcher.find()) {
                // System.out.println("h: "+matcher.group(1)+"; m: "+matcher.group(2)+"; title: "+matcher.group(3)+"; short: "+matcher.group(4)+"; desc: "+matcher.group(5));
                int h = Integer.parseInt(matcher.group(1));
                int m = Integer.parseInt(matcher.group(2));
                String title = matcher.group(3);
                String shortInfo = matcher.group(4);
                String description = matcher.group(5);

                ProgramFrame frame = new ProgramFrame();
                frame.addProgramField(ProgramField.create(ProgramFieldType.START_TIME_TYPE, h * 60 + m));
                frame.addProgramField(ProgramField.create(ProgramFieldType.TITLE_TYPE, title));
View Full Code Here

                // System.out.println("h: "+matcher.group(1)+"; m: "+matcher.group(2)+"; title: "+matcher.group(3)+"; short: "+matcher.group(4)+"; desc: "+matcher.group(5));
                int h = Integer.parseInt(matcher.group(1));
                int m = Integer.parseInt(matcher.group(2));
                String title = matcher.group(3);
                String shortInfo = matcher.group(4);
                String description = matcher.group(5);

                ProgramFrame frame = new ProgramFrame();
                frame.addProgramField(ProgramField.create(ProgramFieldType.START_TIME_TYPE, h * 60 + m));
                frame.addProgramField(ProgramField.create(ProgramFieldType.TITLE_TYPE, title));
                frame.addProgramField(ProgramField.create(ProgramFieldType.SHORT_DESCRIPTION_TYPE, shortInfo));
View Full Code Here

    String parentName = "";
    int lastlength = 0; // used in newline trimming to see if one block immediately follows the previous
    while (matcher.find())
    {
      // BEGIN: newline trimming
      String after = matcher.group(3); // contents after tag
      if (lastlength == 0 || fileText.charAt(matcher.start() - 1) == '\n') {
        after = after.replaceFirst("^\\r?\\n", "");
      }
      lastlength = after.length();
      // END: newline trimming
View Full Code Here

      if (lastlength == 0 || fileText.charAt(matcher.start() - 1) == '\n') {
        after = after.replaceFirst("^\\r?\\n", "");
      }
      lastlength = after.length();
      // END: newline trimming
      if (matcher.group(1).toUpperCase().equals("BEGIN"))
      {
        parentName = implode(blockNames);
        blockNames.add(matcher.group(2));
        String currentBlockName = implode(blockNames);
        if (blocks.containsKey(currentBlockName))
View Full Code Here

      lastlength = after.length();
      // END: newline trimming
      if (matcher.group(1).toUpperCase().equals("BEGIN"))
      {
        parentName = implode(blockNames);
        blockNames.add(matcher.group(2));
        String currentBlockName = implode(blockNames);
        if (blocks.containsKey(currentBlockName))
        {
          blocks.put(currentBlockName, blocks.get(currentBlockName) + after);
        }
View Full Code Here

          blocks.put(parentName, "{_BLOCK_." + currentBlockName + "}");
        }
        subBlocks.put(parentName, currentBlockName);
        subBlocks.put(currentBlockName, "");
      }
      else if (matcher.group(1).toUpperCase().equals("END"))
      {
        blockNames.remove(blockNames.size()-1);
        parentName = implode(blockNames);
        if (blocks.containsKey(parentName))
        {
View Full Code Here

    Pattern pattern = Pattern.compile("\\{([\\w\\.]+)\\}");
    Matcher matcher = pattern.matcher(copy);
    pattern = Pattern.compile("_BLOCK_\\.(.+)");
    for (Matcher matcher2; matcher.find();)
    {
      String match = matcher.group(1);
      matcher2 = pattern.matcher(match);
      if (matcher2.find())
      {
        if (parsedBlocks.containsKey(matcher2.group(1)))
        {
View Full Code Here

            if (end != -1) {
                String resource = content.substring(start, end);
                // extract  medium and line
                Matcher matcher =Pattern.compile("\\(.*\\)").matcher(resource);
                while (matcher.find()) {
                    String group = matcher.group();
                    String[] parts = group.split("\\) \\(");
                    if (parts.length == 2) {
                        warning.setMedium(parts[0].substring(1));
                        String line = parts[1].substring(0, parts[1].length()-1);
                        line = line.substring(line.indexOf(" ")).trim();
View Full Code Here

            if (end != -1) {
                String temp = content.substring(start, end);
                // extract  medium and line
                Matcher matcher =Pattern.compile("\\(.*\\)").matcher(temp);
                if (matcher.find()) {
                    String group = matcher.group();
                    warning.setDb(group.substring(1, group.length()-1));
                }
            }
           
            start = content.indexOf("- Message:");
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.