Example usage for java.lang String replaceAll

List of usage examples for java.lang String replaceAll

Introduction

In this page you can find the example usage for java.lang String replaceAll.

Prototype

public String replaceAll(String regex, String replacement) 

Source Link

Document

Replaces each substring of this string that matches the given regular expression with the given replacement.

Usage

From source file:Main.java

private static String markdown2HtmlLink(String link) {
    return link.replaceAll("\\[([^\\]]*?)\\]\\((.*?)\\)", "<a href=\"" + "$2" + "\">" + "$1" + "</a>");
}

From source file:Main.java

public static String formatClassStr(String clazz) {
    return clazz.replaceAll("\\.", "_");
}

From source file:Strings.java

public static String reduceToAlphaNumerics(String value) {
    return value.replaceAll("[^0-9a-zA-Z]+", " ");
}

From source file:Main.java

public static String cleanPhoneNumber(String phone) {
    return phone.replaceAll("[ ()-]", "");
}

From source file:Main.java

static public String escapeXML(String str) {
    return str.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;")
            .replaceAll("\"", "&quot;").replaceAll("'", "&apos;").replaceAll("\n", "");
}

From source file:Main.java

public static String cleanName(String name) {
    return name.replaceAll("\\[([^\\]]*)\\]", "").replaceAll(" {2,}", " ").trim();
}

From source file:Main.java

public static String decolorize(String string) {
    return string.replaceAll("\\u00A7(?=[0-9a-fk-or])", "&");
}

From source file:Main.java

public static String extractDigits(String input) {
    return input.replaceAll("\\D+", "");
}

From source file:Main.java

public static int getWordCount(String s) {

    s = s.replaceAll("[^\\x00-\\xff]", "**");
    int length = s.length();
    return length;
}

From source file:Main.java

public static String eatBracket(String szText) {
    return szText.replaceAll("\"", "");
}