Re: Needs help with regsub.
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Needs help with regsub.

From: Darren New <dnew@san.rr.com>
Date: Tue Jun 28 2005 - 22:08:21 CEST

Helene Day wrote:
> I read a file that looks like {string1|string2|stringx}
> {stringa|stringb|stringz} etc....

If it always has { and } on the string, just chop the first and last
character.

[string range $line 1 end-1]

Or if you know there aren't other { and } there, try
[string trim $line {{}}]

-- 
   Darren New / San Diego, CA, USA (PST)
     The samba was clearly inspired
     by the margarita.
Received on Thu Sep 29 14:23:28 2005