/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
String s
= "###### Heading6 Something here\r\n" + "###### More text \r\n" +
"###Heading 3 text";
Matcher m = Pattern.compile("(?m)^#{6}(?!#)(.*)").matcher(s);
String result
= m.
replaceAll("<b>$1</b>");
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwucmVnZXguKjsKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlTdHJpbmcgcyA9ICIjIyMjIyMgSGVhZGluZzYgU29tZXRoaW5nIGhlcmVcclxuIiArCgkJICAgICAgICAgICAiIyMjIyMjIE1vcmUgdGV4dCBcclxuIiArCgkJICAgICAgICAgICAiIyMjSGVhZGluZyAzIHRleHQiOwoJCU1hdGNoZXIgbSA9IFBhdHRlcm4uY29tcGlsZSgiKD9tKV4jezZ9KD8hIykoLiopIikubWF0Y2hlcihzKTsKCQlTdHJpbmcgcmVzdWx0ID0gbS5yZXBsYWNlQWxsKCI8Yj4kMTwvYj4iKTsKCQlTeXN0ZW0ub3V0LnByaW50bG4ocmVzdWx0KTsKCgl9Cn0=