Package java.util.regex

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


    try {
      FSDataInputStream in=fs.open(new Path(schemaFile));
      br = new BufferedReader(new InputStreamReader(in));
      String temp = null;// 获得的值以空格分隔,"fieldName fieldType"
      while ((temp = br.readLine()) != null) {
        matcher.reset(temp);
        if (matcher.find()) {
          String fnft = matcher.group(1) + " " + matcher.group(2)
              + " " + matcher.group(3) + " " + matcher.group(4);
          System.out.println(fnft);
          list.add(fnft);
View Full Code Here


      FSDataInputStream in = fs.open(new Path(getBasePath(stormconf), tablename
          + "/solr/conf/schema.xml"));
      br = new BufferedReader(new InputStreamReader(in));
      String temp = null;
      while ((temp = br.readLine()) != null) {
        matcher.reset(temp);
        if (matcher.find()) {
          datatype.info.put(matcher.group(1), matcher.group(2));
        }
      }
      in.close();
View Full Code Here

      return null;
    }
    Matcher match = varPat.matcher("");
    String eval = expr;
    for(int s=0; s<MAX_SUBST; s++) {
      match.reset(eval);
      if (!match.find()) {
        return eval;
      }
      String var = match.group();
      var = var.substring(2, var.length()-1); // remove ${ .. }
View Full Code Here

            {
                result = StringUtils.replace( result, wholeExpr, String.valueOf( value ) );
                // could use:
                // result = matcher.replaceFirst( stringValue );
                // but this could result in multiple lookups of stringValue, and replaceAll is not correct behaviour
                matcher.reset( result );
            }
/*
        // This is the desired behaviour, however there are too many crappy poms in the repo and an issue with the
        // timing of executing the interpolation

View Full Code Here

        break;
      }
      if (line.length() > 0 && line.charAt(line.length() - 1) == '\r')
        line = line.substring(0, line.length() - 1);

      matcher = matcher.reset(line);
      ArrayList<DataByteArray> list = new ArrayList<DataByteArray>();
      if (matcher.find()) {
        tryNext=false;
        for (int i = 1; i <= matcher.groupCount(); i++) {
          list.add(new DataByteArray(matcher.group(i)));
View Full Code Here

        Matcher matcher = null;
        for (String appPath : unfilteredAppPaths) {
            if (matcher == null) {
                matcher = filter.matcher(appPath);
            } else {
                matcher.reset(appPath);
            }
            if (matcher.matches()) {
                if (log.isDebugEnabled()) {
                    log.debug(sm.getString("hostConfig.ignorePath", appPath));
                }
View Full Code Here

                            ++lineCount;
                            ++fileLineCount;
                            if(capped) {
                                continue;
                            }
                            target.reset(line);
                            if(target.find()) {
                                if(host != null && !host.equals(target.group(GROUP_HOST))) {
                                    continue;
                                }
                                if(user != null && !user.equals(target.group(GROUP_USER))) {
View Full Code Here

        }
    }

    public Artifact installLibrary(File libFile, String groupId) throws IOException {
        Matcher matcher = MAVEN_1_PATTERN_PART.matcher("");
        matcher.reset(libFile.getName());
        if (matcher.matches()) {
            String artifactId = matcher.group(1);
            String version = matcher.group(2);
            String type = matcher.group(3);
            Artifact artifact = new Artifact(groupId != null ? groupId : Artifact.DEFAULT_GROUP_ID, artifactId, version, type);
View Full Code Here

        PrintWriter out = new PrintWriter(string);
        String line;
        Matcher m = ENCRYPTED_STRING.matcher("");
        try {
            while((line = in.readLine()) != null) {
                m.reset(line);
                int last = -1;
                while(m.find()) {
                    out.print(line.substring(last+1, m.start()));
                    String s = line.substring(m.start(), m.end());
                    out.print("\"");
View Full Code Here

                            ++fileLineCount;
                            if(capped) {
                                continue;
                            }
                            CharSequence line = cb.subSequence(lines.start(), lines.end());
                            target.reset(line);
                            if(target.find()) {
                                if(host != null && !host.equals(target.group(GROUP_HOST))) {
                                    continue;
                                }
                                if(user != null && !user.equals(target.group(GROUP_USER))) {
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.