Package java.util.regex

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


           
      for (int i=0;i<stats_names.size();i++){
       
        String  s = (String)stats_names.get(i);
       
        if ( pattern.matcher( s ).matches()){
         
          expanded.add( s );
        }
      }
     
View Full Code Here


       
        while( pt_it.hasNext()){
         
          String  s = (String)pt_it.next();
         
          if ( pattern.matcher( s ).matches()){
           
            expanded.add( s );
          }
        }
      }
View Full Code Here

        if ((stringField != null) & (req.regexp().length() > 0))
        {
            try
            {
                Pattern pattern = Pattern.compile(req.regexp());
                Matcher matcher = pattern.matcher(stringField);
                if (!matcher.matches())
                    errors.rejectValue(field.getName(), errorCodes[1], req.regexp());
            }
            catch (Exception ex)
            {
View Full Code Here

   
    for (int i=0;i<lan_subnets.size();i++){
     
      Pattern  p = (Pattern)lan_subnets.get(i);
     
      if ( p.matcher( host_address ).matches()){
               
        return( true );
      }
    }
   
View Full Code Here

    }

    public static boolean matchPattern(String fileName, String regex) {
        if (regex == null) return true;
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(fileName);
        return m.matches();
    }

    public static long getFileOrDirectorySize(File tbrDir) {
        long size = 0;
View Full Code Here

    });

    JSAPResult jsapResult = jsap.parse( arg );
    if ( jsap.messagePrinted() ) return;
    Pattern pattern = Pattern.compile( "\t" );
    Matcher matcher = pattern.matcher( "" );
   
    final int h = jsapResult.getInt( "h" );
    final String basename = jsapResult.getString( "basename" );
    final PrintStream printStream[] = new PrintStream[ h + 1 ];
    for( int i = 0; i <= h; i++ ) printStream[ i ] = new PrintStream( new FastBufferedOutputStream( new FileOutputStream( basename + "-" + i + DiskBasedIndex.STATS_EXTENSION ) ) );
View Full Code Here

      }
         
      try
      {
        Pattern log_pattern = Pattern.compile(detect_matcher.group(1));
        Matcher log_matcher = log_pattern.matcher(last_log);
        String result = null;
        if ("g".equals(detect_matcher.group(3)))
        {
          result = log_matcher.replaceAll(detect_matcher.group(2));
        }
View Full Code Here

        if ((stringField != null) & (req.regexp().length() > 0))
        {
            try
            {
                Pattern pattern = Pattern.compile(req.regexp());
                Matcher matcher = pattern.matcher(stringField);
                if (!matcher.matches())
                    errors.rejectValue(field.getName(), errorCodes[1], req.regexp());
            }
            catch (Exception ex)
            {
View Full Code Here

         
            // double check against reg-expr if exists
         
          Pattern p = textFilterPatterns[j];
         
          if ( p == null  || !p.matcher( name ).find()){
         
            valid = false;
         
            break;
          }
View Full Code Here

          valid = false;
          break;
        }else{
          Pattern p = excludeTextFilterPatterns[j];
         
          if ( p != null  && p.matcher( name ).find()){
            valid = false;
            break;
          }
        }
      }
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.