Function pattern (str ){
// Str = str. replace (/(rn | n | r)/ig ,'');
Str = str. replace (/<br [^>] *>/ig, 'n ');
Str = str. replace (/<p [^>/] */>/ig, 'n ');
// Str = str. replace (/[code] (. + ?) [/Code]/ig, function ($1, $2) {return phpcode ($2 );});
Str = str. replace (/son [w] {3, 16} s? = S * (['"]). +? 1/ig ,'');
Str = str. replace (/Str = str. replace (/<(sub | sup | u | strike | B | I | pre)>/ig, '[$1]');
Str = str. replace (/</(sub | sup | u | strike | B | I | pre)>/ig, '[/$1]');
Str = str. replace (/<(/)? Strong>/ig, '[$ 1b]');
Str = str. replace (/<(/)? Em>/ig, '[$ 1i]');
Str = str. replace (/<(/)? Blockquote ([^>] *)>/ig, '[$1 blockquote]');
Str = str. replace (/] * smile = "(d +)" [^>] *>/ig, '[s: $1]');
Str = str. replace (/] * src = ['"s] * ([^ S'"] +) [^>] *>/ig, '[img]' + '$ 1' +' [/img] ');
Str = str. replace (/<a [^>] * href = ['"s] * ([^ S'"] *) [^>] *> (. + ?) </A>/ig, '[url = $1]' + '$ 2' +' [/url] ');
// Str = str. replace (/
Str = str. replace (/<[^>] *?> /Ig ,'');
Str = str. replace (/& amp;/ig ,'&');
Str = str. replace (/& lt;/ig, '<');
Str = str. replace (/& gt;/ig, '> ');
Return str;
}
Function htmltoubb (){
Str = pattern (document. getElementById ("htmlsource"). value );
Document. getElementById ("ubbresult"). value = str;
}