For Programmers: Free Programming Magazines  


Home > Archive > Tcl > June 2007 > Re: Stripping characters from a string









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Stripping characters from a string
Alexandre Ferrieux

2007-06-27, 4:22 am

On Jun 26, 11:38 am, "Donal K. Fellows"
<donal.k.fell...@manchester.ac.uk> wrote:
> Alexandre Ferrieux wrote:
>
> Sometimes it's easier to pick out the characters you want to keep instead:
>
> set y [regexp -all -inline {\w+} $x]


Sure. But hardly more readable :-)
Moreover, it produces a list, whose string rep may be a bit decorated:

% regexp -all -inline {[$]+} { abc$def$ghi }
{$} {$}

-Alex

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com