• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Replace chr(10) with <br> unless between table tags?

Explorer ,
Jul 24, 2006 Jul 24, 2006

Copy link to clipboard

Copied

How do I replace any chr(10)'s with a br unless the chr(10) are within a table tag?

If a user enters this, into a record, I don't want the BRs to be placed in the table.

<table>
<tr>
<td>
</td>
</tr>
</table>

<cfset resolution2 = #Replace(resolution,"#chr(10)#","<br>","all")#>

Any clues?

Thanks!
TOPICS
Advanced techniques

Views

286

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 24, 2006 Jul 24, 2006

Copy link to clipboard

Copied

LATEST
You could probably do this with a regular expression and ReReplace().
But I am not strong enough at regex to actually give some code.

jimmy.hunt wrote:
> How do I replace any chr(10)'s with a br unless the chr(10) are within a table
> tag?
>
> If a user enters this, into a record, I don't want the BRs to be placed in the
> table.
>
> <table>
> <tr>
> <td>
> </td>
> </tr>
> </table>
>
> <cfset resolution2 = #Replace(resolution,"#chr(10)#","<br>","all")#>
>
> Any clues?
>
> Thanks!
>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation