Re: how to identify string between flower braces
- From: Glenn Jackman <glennj@xxxxxx>
- Date: 28 Nov 2006 00:56:07 GMT
At 2006-11-27 06:31PM, "tampabay.bucks@xxxxxxxxx" wrote:
Hi
My string would be something like this.
"{{8} {Security Configuration} {null} {}} {{10} {Device Configuration}
{yes}}"
So my goal is take the value present inside the flower braces that is
immediately after {Security Configuration}.
If you *know* your data are well-defined lists:
set x "{{8} {Security Configuration} {null} {}} {{10} {Device Configuration} {yes}}"
set term "Security Configuration"
set sublist [lsearch -inline $x "*$term*"]
if {$sublist ne ""} {
set term_index [lsearch -exact $sublist $term]
set value [lindex $sublist [incr term_index]]
}
If you cannot guarantee list-ness, then
regexp "{$term}\\s+{(\[^}\]+)" $x -> value
--
Glenn Jackman
Ulterior Designer
.
- References:
- how to identify string between flower braces
- From: tampabay . bucks
- Re: how to identify string between flower braces
- From: Pat Thoyts
- Re: how to identify string between flower braces
- From: Bryan Oakley
- Re: how to identify string between flower braces
- From: tampabay . bucks
- how to identify string between flower braces
- Prev by Date: Re: Is there a way to make 'wish' read standard input?
- Next by Date: Re: how to identify string between flower braces
- Previous by thread: Re: how to identify string between flower braces
- Next by thread: Re: how to identify string between flower braces
- Index(es):
Relevant Pages
|