reReplacing textareas sequentially

The following code replaces everything from the first opening textarea to the last closing textarea.  I'd like to replace one at a time in order of sequential occurrence.  How do I write the regular expression to replace between the first occurrence of each opening and closing tag rather than the first occurrence of the opening tag and the last occurrence of the closing tag.

<cfset request.revisedContent = rereplacenocase(request.revisedContent, '(<textarea[^>]*>).*(</textarea[^>]*>)', request.textContent, 'one') />

Open in new window

LVL 1
brianmfallsAsked:
Who is Participating?
 
hieloCommented:
to locate the "next immediate closing textarea" try:

(<textarea[^>]*>).*?(</textarea>)

notice the ? after the *

Open in new window

0
 
_agx_Commented:
Do you want to remove the <textarea> tags entirely or just replace what's inside them?

0
 
brianmfallsAuthor Commented:
Thanks!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.