RESULTS:
Execution Time(sec.):
0.000033
Raw Match Pattern:
^(?:https?://)?(?:\\w+\\.)?(\\w+)(?:\\.\\w+).*$
Raw Replace Pattern:
\\1
Java Code Example:
import java.util.regex.Pattern;
import java.util.regex.Matcher;
class Module1{
public static void main(String[] asd){
String sourcestring = "source string to match with pattern";
Pattern re = Pattern.compile("^(?:https?://)?(?:\\\\w+\\\\.)?(\\\\w+)(?:\\\\.\\\\w+).*$",Pattern.MULTILINE);
Matcher m = re.matcher(sourcestring);
String result = m.replaceAll("\\\\1");
}
}
$sourcestring after replacement:
NO MATCHES. SOURCE TEXT UNCHANGED.