Package java.util.regex

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


    final FastBufferedReader reader = new FastBufferedReader( new InputStreamReader( System.in ) );
   
    int l, start;
    while( reader.readLine( line ) != null ) {
      if ( line.charAt( 0 ) == '#' ) continue;
      matcher.reset( line );
      l = 0;
      start = 0;
      while( matcher.find() && l <= h ) {
        printStream[ l ].println( line.subSequence( start, matcher.start() ) );
        start = matcher.end();
View Full Code Here


            for (Map.Entry<String, Matcher> entry : predicateList.entrySet()) {
                final String column = entry.getKey();
                final String value =
                    XmlaOlap4jUtil.stringElement(row, column);
                final Matcher matcher = entry.getValue();
                if (!matcher.reset(value).matches()) {
                    continue rowLoop;
                }
            }
            for (XmlaOlap4jConnection.MetadataColumn column
                : metadataRequest.columns)
View Full Code Here

        int lc = 0;
        for (final String logLine : log) {
            final String nextLogLine = logLine.trim();

            if (filterMatcher != null) {
              filterMatcher.reset(nextLogLine);
              if (!filterMatcher.find()) continue;
            }

            if (nextLogLine.startsWith("E ")) {
                level = 4;
View Full Code Here

    // TODO: this should go away once we have proper tags
    public String replaceAllTags(String self, String s1, String s2, Pattern regex) {
        Matcher matcher = regex.matcher(self);
        if (matcher.find()) {
            matcher.reset();
            StringBuffer sb = new StringBuffer();
            while (matcher.find()) {
                String tagname = matcher.group(1);
                if (!tagname.equals("interface")) {
                    String content = encodeSpecialSymbols(matcher.group(2));
View Full Code Here

    // TODO: is there a better way to do this?
    public String replaceAllTagsCollated(String self, String preKey, String postKey,
                                         String valueSeparator, String postValues, Pattern regex) {
        Matcher matcher = regex.matcher(self + "@endMarker");
        if (matcher.find()) {
            matcher.reset();
            Map<String, List<String>> savedTags = new HashMap<String, List<String>>();
            StringBuffer sb = new StringBuffer();
            while (matcher.find()) {
                String tagname = matcher.group(1);
                if (!tagname.equals("interface")) {
View Full Code Here

    if (null == value) {
      return false;
    }

    Matcher matcher = getMatcher();
    matcher.reset(value.toString());

    return matcher.matches();
  }

  /**
 
View Full Code Here

        int end = qm.find() ? qm.start() : p.length();
        final Matcher matcher = backPathPattern.matcher(p);
        while (matcher.find()) {
            if (matcher.start() > end) break;
            p = matcher.replaceAll("");
            matcher.reset(p);
        }
        return p.equals("") ? "/" : p;
    }
   
    /**
 
View Full Code Here

  @Override
  public String[] transform(InputRow inputRow) {
    final Matcher matcher = pattern.matcher("");
    final String value = inputRow.getValue(column);
    final boolean match = value != null && matcher.reset(value).matches();

    String[] result = new String[matcher.groupCount() + 1];
    for (int i = 0; i < result.length; i++) {
      result[i] = match ? matcher.group(i) : null;
    }
View Full Code Here

            return false;
          }
        }

        if (uriMatcher != null) {
          uriMatcher.reset(invocation.getURI());
          if (! uriMatcher.find()) {
            return false;
          }
        }
View Full Code Here

        Matcher m = RUBY_CASE_SPLITTER.matcher(javaCasedName);
        StringBuffer newName = new StringBuffer();
        if (!m.find()) {
            return null;
        }
        m.reset();

        while (m.find()) {
            m.appendReplacement(newName, m.group(1) + Character.toUpperCase(m.group(2).charAt(0)));
        }
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.