Package java.util.regex

Examples of java.util.regex.Pattern.matcher()


    if (pattern == null || pattern.trim().length() == 0) {
      sections.add(new Section());
    } else {
      pattern = pattern.trim().replaceAll("\\\\", "/");
      Pattern p = Pattern.compile("\\A(([a-zA-Z]:)?/)");
      Matcher matcher = p.matcher(pattern);
      // Look if we've got a absolute or a relativ path
      boolean startsWithSysRoot = matcher.lookingAt();
      if (startsWithSysRoot) {
        sections.add(new Section(pattern
            .substring(0, matcher.end() - 1)));
View Full Code Here


          weiter = false ;
        }

        if ( line != null )
        {
          matcher = pattern.matcher( line ) ;

          while ( matcher.find() )
          {
            // extract the bibtex-key(s) XXX from \citation{XXX} string
            int len = matcher.end() - matcher.start() ;
View Full Code Here

        final Pattern toMatch = Pattern
          .compile(dirToProcess.replaceAll("\\\\\\\\", "\\\\"));

        File[] matches = directory.listFiles(new FilenameFilter() {
          public boolean accept(File arg0, String arg1) {
            return toMatch.matcher(arg1).matches();
          }
        });
        if (matches == null || matches.length == 0)
          return null;
View Full Code Here

    final Pattern toMatch = Pattern.compile("^"
      + filenameToLookFor.replaceAll("\\\\\\\\", "\\\\") + "$");

    File[] matches = directory.listFiles(new FilenameFilter() {
      public boolean accept(File arg0, String arg1) {
        return toMatch.matcher(arg1).matches();
      }
    });
    if (matches == null || matches.length == 0)
      return null;
View Full Code Here

      sql = sql.toUpperCase().trim();
      // Bug 1371587 - remove useless accent characters if they exist
      sql = sql.replaceAll("\\`", "");
      Matcher matcher;

      matcher = patternBeforeTable.matcher(sql);
      if(false == matcher.find())
      {
         return null;
      }
      String table = matcher.group(1);
View Full Code Here

         else
         {
            patternBehindTable = Pattern.compile("([A-Z0-9_]+)\\s+|[A-Z0-9_]+$");
         }

         matcher = patternBehindTable.matcher(behindTable);
         if(false == matcher.find())
         {
            return null;
         }
View Full Code Here

        String regexToCompareTo;
        if (right instanceof String) {
            regexToCompareTo = (String) right;
        } else if (right instanceof Pattern) {
            Pattern pattern = (Pattern) right;
            return pattern.matcher(stringToCompare);
        } else {
            regexToCompareTo = toString(right);
        }
        return Pattern.compile(regexToCompareTo).matcher(stringToCompare);
    }
View Full Code Here

            pattern = (Pattern) right;
        } else {
            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) {
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/"
View Full Code Here

 
  public static class JavaSourceFileMethodParametersParser {

        public String[] parseJavaFileForParamNames(Method method,String content) {
            Pattern methodPattern = Pattern.compile("(?s)"+method.getName()+"\\s*\\("+getParamsPattern(method)+"\\)\\s*\\{");
          Matcher m = methodPattern.matcher(content);
          List paramNames = new ArrayList();
          while(m.find()) {
              for(int i = 1; i <= method.getParameterTypes().length; i++) {
                    paramNames.add(m.group(i));
                }
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.