The current version of KefirBB 0.6 is not listed as beta anymore. I find the KefirBB parser very easy to configure and extend with my own tags:
kefir-bb.sourceforge.net
(This is the best BBCode parser I've found so far)
I also found this code at fyhao.com, but it does protect you against incorrectly nested tags (thus not suitable for parsing user entered input):
public static String bbcode(String text) {
String html = text;
Map bbMap = new HashMap();
bbMap.put("(\r\n|\r|\n|\n\r)", "
");
bbMap.put("\\[b\\](.+?)\\[/b\\]", "$1");
bbMap.put("\\[i\\](.+?)\\[/i\\]", "$1");
bbMap.put("\\[u\\](.+?)\\[/u\\]", "$1");
bbMap.put("\\[h1\\](.+?)\\[/h1\\]", "$1
");
bbMap.put("\\[h2\\](.+?)\\[/h2\\]", "$1
");
bbMap.put("\\[h3\\](.+?)\\[/h3\\]", "$1
");
bbMap.put("\\[h4\\](.+?)\\[/h4\\]", "$1
");
bbMap.put("\\[h5\\](.+?)\\[/h5\\]", "$1
");
bbMap.put("\\[h6\\](.+?)\\[/h6\\]", "$1
");
bbMap.put("\\[quote\\](.+?)\\[/quote\\]", "$1
");
bbMap.put("\\[p\\](.+?)\\[/p\\]", "$1
");
bbMap.put("\\[p=(.+?),(.+?)\\](.+?)\\[/p\\]", "$3
");
bbMap.put("\\[center\\](.+?)\\[/center\\]", "$1");
bbMap.put("\\[align=(.+?)\\](.+?)\\[/align\\]", "
$2");
bbMap.put("\\[color=(.+?)\\](.+?)\\[/color\\]", "
$2");
bbMap.put("\\[size=(.+?)\\](.+?)\\[/size\\]", "
$2");
bbMap.put("\\[img\\](.+?)\\[/img\\]", "

");
bbMap.put("\\[img=(.+?),(.+?)\\](.+?)\\[/img\\]", "

");
bbMap.put("\\[email\\](.+?)\\[/email\\]", "
$1");
bbMap.put("\\[email=(.+?)\\](.+?)\\[/email\\]", "
$2");
bbMap.put("\\[url\\](.+?)\\[/url\\]", "
$1");
bbMap.put("\\[url=(.+?)\\](.+?)\\[/url\\]", "
$2");
bbMap.put("\\[youtube\\](.+?)\\[/youtube\\]", "
");
bbMap.put("\\[video\\](.+?)\\[/video\\]", "
");
for (Map.Entry entry: bbMap.entrySet()) {
html = html.replaceAll(entry.getKey().toString(), entry.getValue().toString());
}
return html;
}
BTW javaBBcode is part of opensource project: JavaBB.