Q:

Wrapping markup sentance with sed

Text:
\item Further course of adolescent \uline{maturation and synaptic questions} to identify genes and circuit development factors associated with departures from normal developmental functioning, and \uline{points in prodromal stages where intervention} might particularly be targeted;
Goal: substitute \uline{ text... } to {\color{cname}\uline{ text... }} in the paragraph
Code:
#! /usr/local/bin/zsh
sed -i -n "96,300 {
s/\(\\\\uline{.*}\)/{\\\\color{cname}\1}/g
}" tmpName.tex

# issue: can't parse the second \uline !! 

However, got the output like this:
\item Further course of adolescent {\color{cname}\uline{maturation and synaptic questions} to identify genes and circuit development factors associated with departures from normal developmental functioning, and \uline{points in prodromal stages where intervention}} might particularly be targeted;
Any help would be appreciated ! 

A:

sed  's#\\uline{[^}]*}#{\\color{cname}&}#g' file

add the line range or -i if you needed. 
test with your text:
kent$  cat f
\item Further course of adolescent \uline{maturation and synaptic questions} 
\uline{points in prodromal stages where intervention} foo

kent$  sed  's#\\uline{[^}]*}#{\\color{cname}&}#g' f
\item Further course of adolescent {\color{cname}\uline{maturation and synaptic questions}} 
{\color{cname}\uline{points in prodromal stages where intervention}} foo

