<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0042)http://local-m.smart.hangame.com/index.jsp -->
<HTML lang=ko xml:lang="ko">
<HEAD>
<TITLE>Test</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=viewport content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=medium-dpi">
<LINK rel=stylesheet type=text/css href="test.css">
<script type="text/javascript" language="javascript">
function cleanText() {
var textare = document.getElementById("feedInsert").value;
var cr = textare.match(/[\r\n]{2,}/g);
var a = textare.replace(/[\r\n]{2,}/g,"\r\n");
document.getElementById("feedInsert").value = a;
}
</script>
</HEAD>
<BODY>
<div id="foo" style="width">
<input type="text" class="input_box" id="testText1" value="123"/>
<textarea id="feedInsert" name="content" cols="70" rows="5" οnclick="cleanText();"/></textarea>
</div>
</BODY>
java
private String formateContent(String content) {
Pattern pattern = Pattern.compile("(\r\n)\\1{1,}");
Matcher matcher = pattern.matcher(content);
return matcher.replaceAll("\n");
}