Package java.util.regex

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


      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) {
          timeStampString = value;

          // apply available format replacements to timestamp
          if (value != null) {
View Full Code Here


            } catch (Exception e) {
                System.out.println("Mac header: " + line);
                e.printStackTrace();
                System.exit(1);
            }
            kr.macKeyLen = Integer.parseInt(result.group(1));
            kr.macKey = new byte[kr.macKeyLen];
            state = MacKey;
        }

        void parseResultLine(String line, KatResult kr) {
View Full Code Here

                System.out.println("Header line: " + line);
                e.printStackTrace();
                System.exit(1);
            }

            kr.stateSize = Integer.parseInt(result.group(1));
            kr.hashBitLength = Integer.parseInt(result.group(2));
            kr.msgLength = Integer.parseInt(result.group(3));
            kr.restOfLine = result.group(4);

            if ((kr.msgLength == 0) || (kr.msgLength % 8) != 0)
View Full Code Here

                e.printStackTrace();
                System.exit(1);
            }

            kr.stateSize = Integer.parseInt(result.group(1));
            kr.hashBitLength = Integer.parseInt(result.group(2));
            kr.msgLength = Integer.parseInt(result.group(3));
            kr.restOfLine = result.group(4);

            if ((kr.msgLength == 0) || (kr.msgLength % 8) != 0)
                kr.msg = new byte[(kr.msgLength >> 3) + 1];
View Full Code Here

                System.exit(1);
            }

            kr.stateSize = Integer.parseInt(result.group(1));
            kr.hashBitLength = Integer.parseInt(result.group(2));
            kr.msgLength = Integer.parseInt(result.group(3));
            kr.restOfLine = result.group(4);

            if ((kr.msgLength == 0) || (kr.msgLength % 8) != 0)
                kr.msg = new byte[(kr.msgLength >> 3) + 1];
            else
View Full Code Here

            }

            kr.stateSize = Integer.parseInt(result.group(1));
            kr.hashBitLength = Integer.parseInt(result.group(2));
            kr.msgLength = Integer.parseInt(result.group(3));
            kr.restOfLine = result.group(4);

            if ((kr.msgLength == 0) || (kr.msgLength % 8) != 0)
                kr.msg = new byte[(kr.msgLength >> 3) + 1];
            else
                kr.msg = new byte[kr.msgLength >> 3];
View Full Code Here

            int proxyPort = 8080;
            try {
                s.findInLine("(http://|)([^:/]+)(:|)([0-9]*)(/|)");
                MatchResult m = s.match();
                if (m.groupCount() >= 2) {
                    proxyAddr = m.group(2);
                }
                if ((m.groupCount() >= 4) && (!m.group(4).isEmpty())) {
                    proxyPort = Integer.parseInt(m.group(4));
                }
            } finally {
View Full Code Here

                s.findInLine("(http://|)([^:/]+)(:|)([0-9]*)(/|)");
                MatchResult m = s.match();
                if (m.groupCount() >= 2) {
                    proxyAddr = m.group(2);
                }
                if ((m.groupCount() >= 4) && (!m.group(4).isEmpty())) {
                    proxyPort = Integer.parseInt(m.group(4));
                }
            } finally {
                s.close();
            }
View Full Code Here

                MatchResult m = s.match();
                if (m.groupCount() >= 2) {
                    proxyAddr = m.group(2);
                }
                if ((m.groupCount() >= 4) && (!m.group(4).isEmpty())) {
                    proxyPort = Integer.parseInt(m.group(4));
                }
            } finally {
                s.close();
            }
            if (proxyAddr != null) {
View Full Code Here

      } catch (IllegalStateException e) {
        // Ignore and move on ..
        continue;
      }
      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) {
            for (int sp=0; sp < fmt.searchPattern.size(); sp++) {
              value = value.replaceAll(fmt.searchPattern.get(sp), fmt.replacePattern.get(sp));
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.