Package java.util.regex

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


            matcher = fromPattern.matcher(cb);
            while (matcher.find()) {
                // log.debug("Found match at [" + String.valueOf(offset+matcher.start()) + "]");

                // add one (1) to position to account for newline..
                posList.add(new Long(offset+matcher.start() + 1));
            } // wend

            if (size<FRAME) break;

            offset  += FRAME-STEPBACK;
View Full Code Here


    if ( isMatch) {
      // Test for substitution.
      StringBuffer resultingName = new StringBuffer();
      matcher.appendReplacement( resultingName, this.substitutePattern );
      resultingName.delete( 0, matcher.start() );

      if ( resultingName.length() != 0) {
        logger.debug( "nameDatasetRegExp(): Setting name to \"" + resultingName + "\".");
        dataset.setName( resultingName.toString());
        return true;
View Full Code Here

          matcher = pattern.matcher( line ) ;

          while ( matcher.find() )
          {
            // extract the bibtex-key(s) XXX from \citation{XXX} string
            int len = matcher.end() - matcher.start() ;
            if ( len > 11 )
            {
              String str = matcher.group().substring( matcher.start() + 10,
                  matcher.end() - 1 ) ;
              // could be an comma separated list of keys
View Full Code Here

          {
            // extract the bibtex-key(s) XXX from \citation{XXX} string
            int len = matcher.end() - matcher.start() ;
            if ( len > 11 )
            {
              String str = matcher.group().substring( matcher.start() + 10,
                  matcher.end() - 1 ) ;
              // could be an comma separated list of keys
              String keys[] = str.split( "," ) ;
              if ( keys != null )
              {
View Full Code Here

        appendIndent(halfIndentMarkers.contains(line));

        Matcher m = NEWLINE_PATTERN.matcher(line);
        int sliceStart = 0;
        while (m.find()) {
          CharSequence cs = line.subSequence(sliceStart, m.start());
          out.append(cs);
          appendTailComment(cs.length(), tailComment);
          out.append("\n");
          appendIndent(halfIndentMarkers.contains(line));
          sliceStart = m.end();
View Full Code Here

    StringBuilder sb = new StringBuilder();
    int start = 0;

    Matcher m = TRICKY_JAVA_TOKEN.matcher(str);
    while (m.find()) {
      sb.append(str.substring(start, m.start()));
      start = m.end();
      if (m.group(1) != null) {
        sb.append("'x'");
        if (m.group(2) == null) {
          alertSink.add(new IllegalExpressionError(expr, outputLanguage));
View Full Code Here

  while (i < s.length()) {
      if (m.find(i)) {
    // Anything between the start of the string and the beginning
    // of the format specifier is either fixed text or contains
    // an invalid format string.
    if (m.start() != i) {
        // Make sure we didn't miss any invalid format specifiers
        checkText(s.substring(i, m.start()));
        // Assume previous characters were fixed text
        al.add(new FixedString(s.substring(i, m.start())));
    }
View Full Code Here

    // Anything between the start of the string and the beginning
    // of the format specifier is either fixed text or contains
    // an invalid format string.
    if (m.start() != i) {
        // Make sure we didn't miss any invalid format specifiers
        checkText(s.substring(i, m.start()));
        // Assume previous characters were fixed text
        al.add(new FixedString(s.substring(i, m.start())));
    }

    // Expect 6 groups in regular expression
View Full Code Here

    // an invalid format string.
    if (m.start() != i) {
        // Make sure we didn't miss any invalid format specifiers
        checkText(s.substring(i, m.start()));
        // Assume previous characters were fixed text
        al.add(new FixedString(s.substring(i, m.start())));
    }

    // Expect 6 groups in regular expression
    String[] sa = new String[6];
    for (int j = 0; j < m.groupCount(); j++)
View Full Code Here

   * If the filename has no suffx, return this.
   */
  public FileRef removeExtension() {
    Matcher m = EXTENSION_PATTERN.matcher(name);
    return m.find()
        ? new FileRef(this.store, name.substring(0, m.start()))
        : this;
  }

  public Kind getKind() {
    Matcher m = EXTENSION_PATTERN.matcher(name);
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.