I would like to make a wiki syntax parser in Java. I have one in PHP that goes a little something like this:
private static function runAllConversions($pString) {
$tConverted = $pString;
$tConverted = stripTags($tConverted);
// Bold and italic text.
$tConverted = preg_replace('/\'\'\'\'\'([^\n\']+)\'\'\'\'\'/',
'<strong><i>${1}</i></strong>', $tConverted);
In replacement I was thinking of replaceAll instead of the preg_replace in PHP. I guess it would be something like:
// Bold text in Java.
converted = converted.replaceAll('/\'\'\'([^\n\']+)\'\'\'/',
'<strong>${1}</strong>', converted);
Any one got any good suggestions for that?
Thanks!
'{5}instead of'''''but they are the same./in PHP are specific to PHP. They should not appear in Java’s regex.BTW, you may use an existing MediaWiki parser instead.