Package java.util.regex

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


      Matcher matcher = altSyntaxPattern.matcher(mtStr);
      if(matcher.matches()){
        users.add(matcher.group(1));
      }else{
        matcher = fullSyntaxPattern.matcher(mtStr);
        if(matcher.matches()){
          users.add(matcher.group(1));
        }
      }
    }
    return users;
View Full Code Here


 
  private int getDimensionIndex(Axis axis, String dimensionName)
  {
    int idx;
    Matcher matcher = IDX_PATTERN.matcher(dimensionName);
    if (matcher.matches())
    {
      String idxStr = matcher.group(IDX_GROUP);
      idx = Integer.parseInt(idxStr);
    }
    else
View Full Code Here

 
  private int getLevelDepth(TuplePosition pos, String levelName)
  {
    int depth;
    Matcher matcher = IDX_PATTERN.matcher(levelName);
    if (matcher.matches())
    {
      String depthStr = matcher.group(IDX_GROUP);
      depth = Integer.parseInt(depthStr);
    }
    else
View Full Code Here

      throw new JavaSoundUrlParserException(new NullPointerException());
   
    if (!url.startsWith("javasound://"))
      throw new JavaSoundUrlParserException("Expected URL to start with: " + "javasound://");
    Matcher m = pattern.matcher(url);
    if (!m.matches())
      throw new JavaSoundUrlParserException("URL does not match regular expression for javasound URLs");
   
    int groupCount = m.groupCount();
   
    double rate = AudioFormat.NOT_SPECIFIED;
View Full Code Here

            pattern = Pattern.compile(toString(right));
        }
        String stringToCompare = toString(left);
        Matcher matcher = pattern.matcher(stringToCompare);
        RegexSupport.setLastMatcher(matcher);
        return matcher.matches();
    }

    public static Tuple createTuple(Object[] array) {
        return new Tuple(array);
    }
View Full Code Here

    return pattern.matcher(word).matches();
  }

  public String apply(String word) {
    Matcher matcher = pattern.matcher(word);
    if (!matcher.matches()) { throw new IllegalArgumentException("Word '" + word
        + "' does not match regex: " + pattern.pattern()); }
    return replace(matcher);
  }

  /**
 
View Full Code Here

            // name based guess
            if (buddy.getUser().indexOf("@") == -1) {
                Pattern p = Pattern
                        .compile("^(aim|msn|yahoo|icq|gadu-gadu)[-_.].*");
                Matcher m = p.matcher(buddy.getUser());
                if (m.matches() && m.groupCount() >= 1) {
                    String type = m.group(1);
                    if (type != null) {
                        statusIcon = Standard
                                .getIcon("imagethemes/statusicons/"
                                        + type
View Full Code Here

      public void handle(String nodeId, Object object) {
        Map<String, String> map = Maps.newLinkedHashMap();
        Class<?> cls = object.getClass();
        for (Method method : cls.getMethods()) {
          Matcher m = GETTER_PATTERN.matcher(method.getName());
          if (m.matches() && method.getParameterTypes().length == 0) {
            String propName = m.group(1).toLowerCase() + m.group(2);
            try {
              Object propValue = method.invoke(object);
              handleProperty(nodeId, map, propName, propValue);
            } catch (IllegalAccessException iax) {
View Full Code Here

      int textSegmentCount = textSegments.size();
      if (textSegmentCount > 0) {
        // pull off leading spaces
        Matcher m = LEADING_SPACES.matcher(textSegments.get(0));
        String leadingSpaces = "";
        if (m.matches()) {
          leadingSpaces = exteriorSpaceOperator.apply(m.group(1));
          textSegments.set(0, m.group(2));
        }

        // pull off trailing spaces
View Full Code Here

        }

        // pull off trailing spaces
        m = TRAILING_SPACES.matcher(textSegments.get(textSegmentCount - 1));
        String trailingSpaces = "";
        if (m.matches()) {
          trailingSpaces = exteriorSpaceOperator.apply(m.group(2));
          textSegments.set(textSegmentCount - 1, m.group(1));
        }

        // process interior spaces
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.