Package sunlabs.brazil.util.regexp

Examples of sunlabs.brazil.util.regexp.Regexp


        continue;
    }
    sb.append(line).append('|');
      }
      sb.setLength(sb.length() - 1);
      return new Regexp(sb.toString());
  } catch (Exception e) {
      return null;
  }
    }
View Full Code Here


      patternMap.removeElementAt(index);
      patternMap.removeElementAt(index);
      patternMap.removeElementAt(index);
  } else if (index > 0) {
      patternMap.setElementAt(replacement, ++index);
      patternMap.setElementAt(new Regexp(pattern), ++index);
  } else if (replacement != null) {
      patternMap.addElement(pattern);
      patternMap.addElement(replacement);
      patternMap.addElement(new Regexp(pattern));
  }
    }
View Full Code Here

  /*
   * check the regexp patterns
   */

  for (int i = 0; i<patternMap.size(); i+= 3) {
      Regexp exp = (Regexp) patternMap.elementAt(i+2);
      String replace = exp.sub(fix, (String) patternMap.elementAt(i+1));
      if (replace != null) {
    count++;
    return replace;
      }
  }
View Full Code Here

  match = server.props.getProperty(prefix + "match");
  re = null;
  if (match != null) {
      try {
    re = new Regexp(match, true);
      } catch (Exception e) {
    server.log(Server.LOG_WARNING, prefix, "Bad expression:" + e);
      }
  }
View Full Code Here

  public
  ReStringTokenizer(String str, String re)
  throws IllegalArgumentException {
      super(str, re);
      rs = new Regsub((new Regexp(re)), str);
  }
View Full Code Here

      extract = (exp!=null  && rpl!=null );
      init = false;
      hr.request.log(Server.LOG_DIAGNOSTIC, hr.prefix,
      "extracting content from: " + urlPrefix +
      " with: " + exp);
      re = new Regexp(exp);
  }
  return super.init(hr);
    }
View Full Code Here

    return false;
      }
  } else if (!lastExp.equals(exp)) {
      lastExp = exp;
      matchCase = (props.getProperty(hr.prefix + MATCHCASE) != null);
      re = new Regexp(exp, !matchCase);
      String tag = props.getProperty(hr.prefix + TAG, "font");
      String options = props.getProperty(hr.prefix + OPTIONS,
    "color=red");
      sub = props.getProperty(hr.prefix + SUBSTITUTE);
      if (sub == null) {
View Full Code Here

  String str = server.props.getProperty(prefix + "ssl");
  protocol = server.props.getProperty(prefix + "protocol", "https");
  this.prefix = prefix;
  if (str != null) {
     try {
       ssl = new Regexp(str);
     } catch (Exception e) {
         server.log(Server.LOG_WARNING, prefix,
       "Invalid regular expression for \"ssl\" gateway");
         return false;
     }
View Full Code Here

    static Class[] types = new Class[] {String.class, Properties.class};

    public boolean
    init(Server server, String prefix) {
  isMine = new MatchString(prefix, server.props);
  matchRe = new Regexp(server.props.getProperty(prefix + "match",
    "(^[a-z]+)\\(([^)]+)\\)$"));
  keySub = server.props.getProperty(prefix + "key", "\\2");
  tokenSub=server.props.getProperty(prefix + "token", "\\1");
  StringTokenizer st = new StringTokenizer(
    server.props.getProperty(prefix + "tokens"));
View Full Code Here

  String sub = null;

  public boolean init(String prefix, Properties p) {
      String matchStr=p.getProperty(prefix + "match");
      sub = p.getProperty(prefix + "sub");
      match = new Regexp(matchStr);
      if (match==null || sub == null) {
    System.out.println("Missing 'match' and 'sub'");
    return false;
      }
      return true;
View Full Code Here

TOP

Related Classes of sunlabs.brazil.util.regexp.Regexp

Copyright © 2018 www.massapicom. 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.