Package java.util.regex

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


    Pattern pattern = Pattern.compile("<!--\\s*(BEGIN|END)\\s*:\\s*(\\w+)\\s*-->(.*?)(?=(?:<!--\\s*(?:BEGIN|END)\\s*:\\s*\\w+\\s*-->)|(?:\\s*$))", Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
    Matcher matcher = pattern.matcher(fileText);
    ArrayList blockNames = new ArrayList();
    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", "");
View Full Code Here


              " Matches " + locateBlock(blockName));
    }
    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())
      {
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);
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));
                }
            }
           
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);
View Full Code Here

        return TimeUtils.parseTimeString(s);
      } catch (RuntimeDroolsException e) {
        // cannot parse delay, trying to interpret it
        Map<String, String> replacements = new HashMap<String, String>();
        Matcher matcher = PARAMETER_MATCHER.matcher(s);
            while (matcher.find()) {
              String paramName = matcher.group(1);
              if (replacements.get(paramName) == null) {
                  VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                      resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
                    if (variableScopeInstance != null) {
View Full Code Here

        for (Map.Entry<String, Object> entry: workItem.getParameters().entrySet()) {
            if (entry.getValue() instanceof String) {
                String s = (String) entry.getValue();
                Map<String, String> replacements = new HashMap<String, String>();
                Matcher matcher = PARAMETER_MATCHER.matcher(s);
                while (matcher.find()) {
                    String paramName = matcher.group(1);
                    if (replacements.get(paramName) == null) {
                        VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                            resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
                        if (variableScopeInstance != null) {
View Full Code Here

        }
        String processId = getSubProcessNode().getProcessId();
        // resolve processId if necessary
        Map<String, String> replacements = new HashMap<String, String>();
    Matcher matcher = PARAMETER_MATCHER.matcher(processId);
        while (matcher.find()) {
          String paramName = matcher.group(1);
          if (replacements.get(paramName) == null) {
              VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                  resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
                if (variableScopeInstance != null) {
View Full Code Here

        return TimeUtils.parseTimeString(s);
      } catch (RuntimeDroolsException e) {
        // cannot parse delay, trying to interpret it
        Map<String, String> replacements = new HashMap<String, String>();
        Matcher matcher = PARAMETER_MATCHER.matcher(s);
            while (matcher.find()) {
              String paramName = matcher.group(1);
              if (replacements.get(paramName) == null) {
                  VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
                      resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
                    if (variableScopeInstance != null) {
View Full Code Here

                String alternate = pi.substring(start + 1, pi.indexOf(pi.charAt(start), start + 1));
                //TODO: handle alternate stylesheets
                if (alternate.equals("yes")) continue;//DON'T get alternate stylesheets for now
            }
            m = _typePattern.matcher(pi);
            if (m.find()) {
                int start = m.end();
                String type = pi.substring(start + 1, pi.indexOf(pi.charAt(start), start + 1));
                //TODO: handle other stylesheet types
                if (!type.equals("text/css")) continue;//for now
                info.setType(type);
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.