Examples of replaceAll()


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

          }
         
          encoded_message = ChannelLog.convertUrl(encoded_message, ChannelLog.URL_HIGHLIGHT);

          Matcher email_matcher = ChannelLog.EMAIL_HIGHLIGHT.matcher(encoded_message);
          encoded_message = email_matcher.replaceAll("<a href=\"mailto:$1\">$1</a>");

          mTemplate.setValue("nickname", nickname);
          mTemplate.setValue("message", encoded_message);

          mTemplate.appendBlock("messages", "message");
View Full Code Here

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

        s = removeValuesBetween("(", ")", s);
        s = removeValuesBetween("[", "]", s);

        for (int i = 0; i < normalizer.length; i++) {
            Matcher ma = normalizer[i].matcher(s);
            s = ma.replaceAll(" ");
        }
       
        s = s.replaceAll("\n", "");
        s = s.replaceAll("\r", "");
       
View Full Code Here

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

            String regex = DcModules.get(getModule()).getSettings().getString(DcRepository.ModuleSettings.stTitleCleanupRegex);
            if (!Utilities.isEmpty(regex)) {
                Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
                Matcher matcher = pattern.matcher(name);
                while (matcher.find())
                    name = matcher.replaceAll("");
            }
        }
       
        return StringUtils.capitalize(name.trim());
    }   
View Full Code Here

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

            hasURL = htmlMatcher.find(urlInfo.relStartPos);
          }
        }
      } else {
        Matcher htmlMatcher = patHREF.matcher(string);
        string = htmlMatcher.replaceAll("$2");
      }
    }

    Rectangle rectDraw = new Rectangle(printArea.x, printArea.y,
        printArea.width, printArea.height);
View Full Code Here

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

          hasURL = htmlMatcher.find(urlInfo.relStartPos);
        }
      }
    } else {
      Matcher htmlMatcher = patHREF.matcher(string);
      string = htmlMatcher.replaceAll("$2");
    }

    Rectangle rectDraw = new Rectangle(printArea.x, printArea.y,
        printArea.width, printArea.height);
View Full Code Here

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

        }

        //Try it as a url
        try {
            Matcher       m = Pattern.compile(" ").matcher(resourceName);
            String        encodedUrl = m.replaceAll("%20");
            URL           dataUrl    = new URL(encodedUrl);
            URLConnection connection = dataUrl.openConnection();
            s = connection.getInputStream();
        } catch (Exception exc) {}
View Full Code Here

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

            // parse the arguments into name value pairs
            nameValue = args[i].split("=");
            if (nameValue.length == 1)
                nameValue = new String[] { nameValue[0], "true" };
            matcher = Pattern.compile("-").matcher(nameValue[0]);
            keyValue = matcher.replaceAll("");
            com.valhalla.Logger.debug("Argument> " + keyValue + "="
                    + nameValue[1]);
            setProperty(keyValue, nameValue[1]);
        }
    }
View Full Code Here

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

   Matcher matcher = null; in = out.toString();

   //*-- replace consecutive spaces with single space and remove leading/trailing spaces
   in = in.trim();
   matcher = spacesPattern.matcher(in);
   in = matcher.replaceAll(" ");
  }
  catch (OutOfMemoryError e) { return in; }

  return in;
}
View Full Code Here

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

  * @return String Text string without ampersand strings
  */
public static String removeAmpersandStrings (String in)
if (in.length() > STRING_TOOLS_LIMIT) return(in);
Matcher matcher = removeAmpersandPattern.matcher(in);    
return( matcher.replaceAll("") );
}
/**
  * Escape back slashes
  * @param in Text to be escaped
  * @return String Escaped test
View Full Code Here

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

                            (pos.equals("v")) ? (String) verbSuffixes.get(suffix): (String) adjSuffixes.get(suffix);

      //*-- create upto two possible replacements suffixes, a suffix ending with a ':' has two possibilities
      if (replacement.endsWith(":"))
       { String[] replStrings = replacement.split(":");
         words[0] = matcher.replaceAll(root + replStrings[0]);
         words[1] = matcher.replaceAll(root);
       }
      else words[0] = matcher.replaceAll(root + replacement);

      //*-- try the longer suffix first
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.