Package java.util.regex

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


        if (!m.matches()) {
            throw new BadSpecial(SqltoolRB.pl_malformat.getString());
            // I think it's impossible to get here, since the pattern is
            // so liberal.
        }
        if (m.groupCount() < 1 || m.group(1) == null) {
            plMode = true;
            stdprintln(SqltoolRB.pl_expansionmode.getString("on"));
            return;
        }
View Full Code Here


        m = varsetPattern.matcher(dereference(string, false));
        if (!m.matches()) {
            throw new BadSpecial(SqltoolRB.pl_unknown.getString(tokens[0]));
        }
        if (m.groupCount() < 2 || m.groupCount() > 3) {
            // Assertion
            throw new RuntimeException("varset pattern matched but captured "
                    + m.groupCount() + " groups");
        }
View Full Code Here

        m = varsetPattern.matcher(dereference(string, false));
        if (!m.matches()) {
            throw new BadSpecial(SqltoolRB.pl_unknown.getString(tokens[0]));
        }
        if (m.groupCount() < 2 || m.groupCount() > 3) {
            // Assertion
            throw new RuntimeException("varset pattern matched but captured "
                    + m.groupCount() + " groups");
        }
View Full Code Here

            throw new BadSpecial(SqltoolRB.pl_unknown.getString(tokens[0]));
        }
        if (m.groupCount() < 2 || m.groupCount() > 3) {
            // Assertion
            throw new RuntimeException("varset pattern matched but captured "
                    + m.groupCount() + " groups");
        }

        String varName  = m.group(1);

        if (varName.indexOf(':') > -1) {
View Full Code Here

        switch (m.group(2).charAt(0)) {
            case '_' :
                silentFetch = true;
            case '~' :
                if (m.groupCount() > 2 && m.group(3) != null) {
                    throw new BadSpecial(SqltoolRB.plvar_tildedash_nomoreargs.getString(
                            m.group(3)));
                }

                shared.userVars.remove(varName);
View Full Code Here

                    return;
                } catch (UnsupportedEncodingException use) {
                    throw new BadSpecial(
                            SqltoolRB.encode_fail.getString(m.group(3)));
                }
                if (m.groupCount() > 2 && m.group(3) != null) {
                    shared.userVars.put(varName, m.group(3));
                } else {
                    shared.userVars.remove(varName);
                }
                updateUserSettings();
View Full Code Here

    //WebAppDeployControlleryController entry = new WebAppDeployControlleryController(this, contextPath);
    HashMap<String,Object> varMap = new HashMap<String,Object>();
    // entry.getVariableMap();
       
    for (int j = 0; j <= matcher.groupCount(); j++) {
      vars.add(matcher.group(j));
      varMap.put("app" + j, matcher.group(j));
    }

    varMap.put("regexp", vars);
View Full Code Here

    return this.link != null && this.reference == null;
  }

  private static boolean isHFile(final Path path) {
    Matcher m = HFILE_NAME_PATTERN.matcher(path.getName());
    return m.matches() && m.groupCount() > 0;
  }

  /**
   * @param p Path to check.
   * @return True if the path has format of a HStoreFile reference.
View Full Code Here

   * @param name file name to check.
   * @return True if the path has format of a HStoreFile reference.
   */
  public static boolean isReference(final String name) {
    Matcher m = REF_NAME_PATTERN.matcher(name);
    return m.matches() && m.groupCount() > 1;
  }

  /*
   * Return path to the file referred to by a Reference.  Presumes a directory
   * hierarchy of <code>${hbase.rootdir}/tablename/regionname/familyname</code>.
View Full Code Here

        String matchedValue = value;
        // if we cannot find a match set the value to empty string
        Matcher matcher = pattern.matcher(value);
        if (matcher.matches()) {
           
            if (matcher.groupCount() >= group) {
                matchedValue = matcher.group(group);
            } else {
                if (synLog.isTraceOrDebugEnabled()) {
                    String msg = "Failed to get a match for regx : " +
                            pattern.toString() + " with the property value :" +
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.