Examples of toMatchResult()


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

      Pattern pattern = fmt.regexPattern;
      Matcher matcher = pattern.matcher(eventStr);
      if (! matcher.matches()) {
        continue;
      }
      MatchResult res = matcher.toMatchResult();
      for (int grp=1; grp <= res.groupCount(); grp++) {
        String value = res.group(grp);
        if (grp == SYSLOG_TIMESTAMP_POS) {
          // apply available format replacements to timestamp
          if (value != null) {
View Full Code Here

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

                        new CheckResult(this, false, fieldName, value,
                        String.format("Regular expression: '%1$s'", regexp)));
            }
           
            // Populate variable scope with matched parts
            MatchResult res = m.toMatchResult();
            int groupCount = res.groupCount();
            for (int i = 0; i <= groupCount; ++i) {
                variables.setVariable(Integer.toString(i), res.group(i));
            }
            variables.setVariable("groupCount", Integer.toString(groupCount));
View Full Code Here

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

     * @param message The StopWatch message to parse.
     * @return The MatchResult from matching the message, or null if it didn't match.
     */
    public MatchResult match(String message) {
        Matcher matcher = getPattern().matcher(message);
        return matcher.find() ? matcher.toMatchResult() : null;
    }

    /**
     * Helper method returns a new StopWatch from the MatchResult returned when a log messages matches.
     *
 
View Full Code Here

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

        // Check each occurrence of the variable for safety
        p = Pattern.compile("([?$]" + var + ")([^\\w]|$)");
        Matcher matcher = p.matcher(command);
        while (matcher.find()) {
            MatchResult posMatch = matcher.toMatchResult();

            if (n.isLiteral()) {
                if (delims.isInsideLiteral(posMatch.start(1), posMatch.end(1))) {
                    throw new ARQException(
                            "Command string is vunerable to injection attack, variable ?"
View Full Code Here

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

        int index = -1;
        int adj = 0;
        Matcher matcher = p.matcher(command);
        while (matcher.find()) {
            index++;
            MatchResult posMatch = matcher.toMatchResult();

            Node n = this.positionalParams.get(index);
            if (n == null)
                continue;
            this.validateSafeToInject(command, index, posMatch.start(1) + adj, n);
View Full Code Here

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

        int lastx = 0;

        while (matcher.find())
        {
            MatchResult matchResult = matcher.toMatchResult();

            int start = matchResult.start();
            int end = matchResult.end();

            builder.append(name.substring(lastx, start + 1));
View Full Code Here

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

                for (line = lr.readLine(); line != null; line = lr.readLine())
                {
                    // if (line.matches(MEDIABOX_PATT))
                    Matcher mm = MEDIABOX_PATT.matcher(line);
                    if (mm.matches())
                        mediaBox = mm.toMatchResult();
                }
                int istatus = pdfProc.waitFor();
                if (istatus != 0)
                    log.error("XPDF pdfinfo proc failed, exit status="+istatus+", file="+sourceTmp);
                if (mediaBox == null)
View Full Code Here

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

            String line;
            for (line = lr.readLine(); line != null; line = lr.readLine())
            {
                Matcher mm1 = PAGES_PATT.matcher(line);
                if (mm1.matches())
                    pages = mm1.toMatchResult();
                Matcher mm2 = MEDIABOX_PATT.matcher(line);
                if (mm2.matches())
                    pageSizes.add(mm2.toMatchResult());
            }
View Full Code Here

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

                Matcher mm1 = PAGES_PATT.matcher(line);
                if (mm1.matches())
                    pages = mm1.toMatchResult();
                Matcher mm2 = MEDIABOX_PATT.matcher(line);
                if (mm2.matches())
                    pageSizes.add(mm2.toMatchResult());
            }

            int istatus = pdfProc.waitFor();
            if (istatus != 0)
                logger.error("pdfinfo proc failed, exit status=" + istatus + ", file=" + sourcePath);
View Full Code Here

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

    }

    private static String getPropertyName(String name, Pattern pattern) {
        Matcher matcher = pattern.matcher(name);
        if (matcher.matches()) {
            return matcher.toMatchResult().group(1);
        }
        return null;
    }
}
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.