Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var input = "My phone is 1234567890 and my office is 7894561230";
- var output = "My phone is <u>1234567890</u> and my office is <u>7894561230</u>";
- String input = "My phone is 1234567890 and my office is 7894561230";
- String regex = "\d{4,}";
- String output = input.replaceAll(regex, "<u>$0</u>");
- System.out.println(output);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement