Package org.apache.regexp

Examples of org.apache.regexp.RE.subst()


   public String addSlashes (String in)
   {
  String out = null;
try {
  RE r = new RE("'")
  out = r.subst (in, "\\'");

} catch (Exception e) {
  e.printStackTrace();
}
  return (out);
View Full Code Here


   public String removeSlashes (String in)
   {
  String out = null;
try {
  RE r = new RE("\\'")
  out = r.subst (in, "'");

} catch (Exception e) {
  e.printStackTrace();
}
  return (out);
View Full Code Here

   public String getHTMLname (String docID)
   {
     String docName = null;
try {
  RE r = new RE("xml$");
  docName = r.subst (docID,"html");
}
catch (Exception e) {
  e.printStackTrace();
}
  return (docName);
View Full Code Here

  fileHandler.createDocDir (docID, this.imgDir + "/");

  // We are going to store the image with the same directory structure
  // of the document
  RE r = new RE("([:alnum:]*).xml$");
  imgPath = r.subst (docID,"");

  uploadImg = this.initValues.readValue ("HTTP Parameters", "art_image");
  if ( uploadImg == null ) {
    // Nothing downloaded...
    return (null);
View Full Code Here

   */
  public static boolean isLike(String string, String mask, boolean ignoreCase) {
    try {
      // ? --> .
      RE re = new RE("\\?");
      String a = re.subst(mask, ".");
      // * --> .*
      re = new RE("\\*");
      String b = re.subst(a, ".*");
      // % --> .*
      re = new RE("\\%");
View Full Code Here

      // ? --> .
      RE re = new RE("\\?");
      String a = re.subst(mask, ".");
      // * --> .*
      re = new RE("\\*");
      String b = re.subst(a, ".*");
      // % --> .*
      re = new RE("\\%");
      String c = re.subst(b, ".*");
      // end with $ if started with .*
      if (c.startsWith(".*")) {
View Full Code Here

      // * --> .*
      re = new RE("\\*");
      String b = re.subst(a, ".*");
      // % --> .*
      re = new RE("\\%");
      String c = re.subst(b, ".*");
      // end with $ if started with .*
      if (c.startsWith(".*")) {
        c = c + "$";
      }
      // start with ^ if ended with .*
 
View Full Code Here

        }
        argument = result.toString();

        RE reg = getCompiledPattern(options);
        int sOptions = getSubsOptions(options);
        return reg.subst(input, argument, sOptions);
    }   
}
View Full Code Here

        }
        argument = result.toString();

        RE reg = getCompiledPattern(options);
        int sOptions = getSubsOptions(options);
        return reg.subst(input, argument, sOptions);
    }
}
View Full Code Here

     * If the split level String exits in the original source it must be masked
     */
    public String mask( String aText ) {
        try {
            RE regexp = new RE( SPLIT_CHARACTER );
            aText = regexp.subst( aText, SPLIT_CHARACTER + SPLIT_CHARACTER );
        } catch (RESyntaxException e) {
            printEx( "false regexp in mask", e );
        }
        return aText;
    }
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.