Package java.util.regex

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


    }

    protected boolean handleBody(HttpRequest request, HttpResponse response) throws IOException {
        Matcher urlMatch = rule.matcher( request.getUrl() );
        StringBuffer buffer = null;
        if(urlMatch.find()) {
            if( buffer == null ) {
                buffer = new StringBuffer( substitution );
            }
            int lastIndex = 0;
            do {
View Full Code Here


       
        Matcher m = keyword.matcher(p);
        ArrayList rslt = new ArrayList();
        int pos = 0;
//        rslt.add("");
        while (m.find()) {
            if (m.start()>pos || pos==0) {
                rslt.add(p.substring(pos,m.start()));
            }
            rslt.add(p.substring(m.start(),m.end()));
            pos = m.end();
View Full Code Here

                  handled = true;

                }else if ( lc_agent.contains( "sec_hhp")) {
                  Matcher match = Pattern.compile("SEC_HHP_(.*)/").matcher(user_agent);
                  if (match.find()) {
                    String name = match.group(1);
                    handleGeneric(client_address, "SEC_HPP_" + name, name);
                    handled = true;
                  }

View Full Code Here

  {
    for ( Pattern p: device_renames ){
   
      Matcher m = p.matcher( name );
   
      if ( m.find()){
     
        String  new_name = m.group(1);
               
        return( new_name );
      }
View Full Code Here

    while( reader.readLine( line ) != null ) {
      if ( line.charAt( 0 ) == '#' ) continue;
      matcher.reset( line );
      l = 0;
      start = 0;
      while( matcher.find() && l <= h ) {
        printStream[ l ].println( line.subSequence( start, matcher.start() ) );
        start = matcher.end();
        l++;
      }
    }
View Full Code Here

  protected void
  init()
  {
    try {
      Matcher m = rootURLPattern.matcher(searchURLFormat);
      if(m.find()) {
        this.rootPage = m.group(1);
      }
    } catch(Exception e) {
      //Didn't find the root url within the URL
      this.rootPage = null;
View Full Code Here

      this.rootPage = null;
    }
   
    try {
      Matcher m = baseURLPattern.matcher(searchURLFormat);
      if(m.find()) {
        this.basePage = m.group(1);
      }
    } catch(Exception e) {
      //Didn't find the root url within the URL
      this.basePage = null;
View Full Code Here

      // List   cookie = (List)url_rd.getProperty( "URL_Set-Cookie" );
     
      try {
        Matcher m = baseTagPattern.matcher(page);
        if(m.find()) {
          basePage = m.group(1);
         
          debugLog( "base_page: " + basePage );
        }
      } catch(Exception e) {
View Full Code Here

               
                  // see if we can pull from description
               
                Matcher m = seed_leecher_pat.matcher( desc );
             
                while( m.find()){
                 
                  String  num = m.group(1);
                 
                  String  type = m.group(2);
                 
View Full Code Here

      s = s.substring(0,s.length()-3).trim();
    }
   
    //Find if the date contains letters
    matcher = hasLettersPattern.matcher(s);
    if(matcher.find()) {
      //We have a date with letters, could be age-based or time based (with a literal month)
     
      //Try to determine if it is age-based or time-based
      matcher = isAgeBasedPattern.matcher(s);
      if(matcher.find()) {
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.