Forum OpenACS Q&A: Re: what is the best practive for extracting xml like info from variables

I agree - if you make it clean xml, you can use the ns_xml libraries, if you just want it to persist, how about using the -column_set flag on the select and you can store it as a TCL native hash.

Look at the example on this page:
https://openacs.org/doc/openacs-4-6-3/db-api-detailed.html

In the section called Placing Column Values in Arrays and Sets

db_foreach users_select "select first_names, last_name from users" -column_set columns {
    # Now $columns is an ns_set.
    doc_body_append "<li>"
    for { set i 0 } { $i < [ns_set size $columns] } { incr i } {
        doc_body_append "[ns_set key $columns $i] is [ns_set value $columns $i]. \n"
    }
}

I know it sounds like you have been second guessed twice, but without more insight its hard to give good advice. Was your real question - "What is wrong with my regex?" :)