Package java.util.regex

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


            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


   
  static CacheHint getQueryCacheOption(String query) {
      Matcher match = CACHE_HINT.matcher(query);
      if (match.matches()) {
        CacheHint hint = new CacheHint();
        if (match.group(2) !=null) {
          hint.setPrefersMemory(true);
        }
        String ttl = match.group(3);
        if (ttl != null) {
          hint.setTtl(Long.valueOf(ttl.substring(4)));
View Full Code Here

      if (match.matches()) {
        CacheHint hint = new CacheHint();
        if (match.group(2) !=null) {
          hint.setPrefersMemory(true);
        }
        String ttl = match.group(3);
        if (ttl != null) {
          hint.setTtl(Long.valueOf(ttl.substring(4)));
        }
        if (match.group(4) != null) {
          hint.setUpdatable(true);
View Full Code Here

        }
        String ttl = match.group(3);
        if (ttl != null) {
          hint.setTtl(Long.valueOf(ttl.substring(4)));
        }
        if (match.group(4) != null) {
          hint.setUpdatable(true);
        }
        String scope =  match.group(5);
        if (scope != null) {
          scope = scope.substring(6);
View Full Code Here

          hint.setTtl(Long.valueOf(ttl.substring(4)));
        }
        if (match.group(4) != null) {
          hint.setUpdatable(true);
        }
        String scope =  match.group(5);
        if (scope != null) {
          scope = scope.substring(6);
          hint.setScope(scope);
        }       
        return hint;
View Full Code Here

      } 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) {
                        Object variableValue = variableScopeInstance.getVariable(paramName);
View Full Code Here

            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) {
                            Object variableValue = variableScopeInstance.getVariable(paramName);
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) {
                    Object variableValue = variableScopeInstance.getVariable(paramName);
View Full Code Here

      } 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) {
                        Object variableValue = variableScopeInstance.getVariable(paramName);
View Full Code Here

    final Matcher matcher = PATTERN.matcher(input);

    while (matcher.find()) {
      for (int i = 1; i <= matcher.groupCount(); i++) {
        if (matcher.group(i) != null) {
          switch (i) {
            case 1: // literal string
              node_list.add(TextNode.create(matcher.group(i)));
              break;
            case 2: // left bracket ([[])
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.