wbr every 5 characters in really long string
I have some users put in really long strings in a text area and when it's displayed the formatting is thrown off because there are no spaces. To fix this I want to insert a wbr every 5 spaces that gives the browser the option to break if it needs to. I have it working in javascript and a version working in coldfusion, but the coldfusion version inserts the wbr every other character. Any idea how to insert a wbr every 5 characters with a REReplace()?
Thanks!
GP
javascript:
<script type="text/javascript" language="JavaScript">
str = '#really_long_text#';
str = str.replace(/(.{5})/g,'$&<wbr/>');
document.write(str)
</script>
ColdFusion:
<cfset str = REReplace(really_long_text, "(.{0})", "<wbr>", "all">
again this does it every other character, but I need it every 5 characters
