Jump to content

Regular expressions: Difference between revisions

m
m (Using libheader)
Line 104:
 
String orig = "I am the original string";
PatternString patresult = Patternorig.compilereplaceAll("original"); // match, "originalmodified");
Matcher mat = pat.matcher(orig); // get the Matcher
String result = mat.replaceAll("modified"); // replace all matches against the pattern with "modified"
// result is now "I am the modified string"
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.