Examples of matcher()


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

   
    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

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

    }

    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

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

    });

    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

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

      }
         
      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

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

        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

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

         
            // 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

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

          valid = false;
          break;
        }else{
          Pattern p = excludeTextFilterPatterns[j];
         
          if ( p != null  && p.matcher( name ).find()){
            valid = false;
            break;
          }
        }
      }
View Full Code Here

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

        int iEarliest = -1;
        String s = filter.regex ? filter.text : "\\Q" + filter.text + "\\E";
        Pattern pattern = Pattern.compile(s, Pattern.CASE_INSENSITIVE);
        for (int i = 0; i < cells.length; i++) {
          Matcher m = pattern.matcher(cells[i].getText());
          if (m.find() && (m.start() < iEarliest || iEarliest == -1)) {
            iEarliest = m.start();
            index = i;
          }
        }
View Full Code Here

Examples of javax.swing.JPanel.matcher()

                            }
                        }
                        String html = b.toString();
                        Pattern p = Pattern.compile("<img.*src=\"([^\\\"\">]+)\"",
                                                    Pattern.CANON_EQ|Pattern.UNICODE_CASE);
                        Matcher m = p.matcher(html);
                        if (m.find()) {
                            URL url = new URL(m.group(1));
                            System.out.println("Load image from " + url);
                            Image image = Toolkit.getDefaultToolkit().getImage(url);
                            setImage(image);
View Full Code Here

Examples of jregex.Pattern.matcher()

                if(excludedChildren.contains(child)) {
                  continue;
                }
                 
                Pattern pat = child.getPattern();
                Matcher m = pat.matcher(txt);
                if(m.find()) {
                 
                    String tokText;
                    int pg = child.getParseGroup();
                    try {
View Full Code Here
TOP
Copyright © 2015 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.