Examples of lookingAt()


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

        String l = line;
        do
        {
            Matcher m = paragraphSeparator.matcher( l );

            if ( m.lookingAt() )
            {
                if ( sawText )
                {
                    break;
                }
View Full Code Here

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

                boolean match = false;
                // Loop until we've covered the entire offset range
                for (int i = 0; i <= offsetRangeEnd - offsetRangeBegin; i++) {
                    m.region(i,  length+i);
                    match = m.lookingAt(); // match regex from start of region
                    if (match) {
                        return type;
                    }
                }
            } else {
View Full Code Here

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

    Pattern p = Pattern.compile("foo.*");

    Matcher m1 = p.matcher("foo123");
    assertTrue(m1.matches());
    assertTrue(m1.find(0));
    assertTrue(m1.lookingAt());

    Matcher m2 = p.matcher("fox");
    assertFalse(m2.matches());
    assertFalse(m2.find(0));
    assertFalse(m2.lookingAt());
View Full Code Here

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

    assertTrue(m1.lookingAt());

    Matcher m2 = p.matcher("fox");
    assertFalse(m2.matches());
    assertFalse(m2.find(0));
    assertFalse(m2.lookingAt());

    assertTrue(Pattern.matches("foo.*", "foo123"));
    assertFalse(Pattern.matches("foo.*", "fox"));

    assertFalse(Pattern.matches("bar", "foobar"));
View Full Code Here

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

          if (offset >= 0 && offset < ts.size()) {
            String offsetText = ts.get(offset).getText();
            if (offsetText.length() > position) {
              Matcher offsetMatcher =
                regex.matcher (offsetText.substring(position));
              if (offsetMatcher.lookingAt())
                countAlignedMatches++;
            }
          }
        }
      }
View Full Code Here

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

      Matcher matcher = regex.matcher (t.getText());
      while (matcher.find()) {
        count++;
        logger.info ("CountMatchesMatching found >"+matcher.group()+"<");
        Matcher moreSpecificMatcher = moreSpecificRegex.matcher (t.getText().substring(matcher.start()));
        if (moreSpecificMatcher.lookingAt ()) {
          moreSpecificCount++;
          logger.info ("CountMatchesMatching sound >"+moreSpecificMatcher.group()+"<");
        }
      }
      if (moreSpecificCount > 0)
View Full Code Here

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

  private static String defaultFileSchema (String string)
  {
    // If "string" does not have a URI scheme (e.g. "file:" or "http:")
    // then assume a default of "file:" and add it.
    Matcher matcher = schemeRegex.matcher (string);
    if (!matcher.lookingAt())
      string = "file:" + string;
    return string;
  }

  public static URI objectToUri (Object obj)
View Full Code Here

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

         }
         else if ((m = source.scan(FUNCTION)) != null)
         {
            encoder.beginGroup(TokenType.function);
            Matcher functionMatcher = FUNCTION_NAME.matcher(m.group());
            functionMatcher.lookingAt();
            String start = functionMatcher.group();
            encoder.textToken(start, TokenType.delimiter);
            if (PARENTHESES_END.matcher(m.group().substring(m.group().length() - 1)).matches())
            {
               if (m.group().length() > start.length() + 1)
View Full Code Here

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

   }

   public MatchResult scan(Pattern pattern)
   {
      Matcher m = pattern.matcher(sequence);
      if (m.lookingAt())
      {
         MatchResult result = new StaticMatchResult(sequence, m);
         sequence.advance(m.end());
         return result;
      }
View Full Code Here

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

   }

   public MatchResult check(Pattern pattern)
   {
      Matcher m = pattern.matcher(sequence);
      if (m.lookingAt())
      {
         return new StaticMatchResult(sequence, m);
      }
      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.