This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
l
loze
Post
by loze » Thu May 23, 2002 11:12 am
I need to remove "Soundic-radio dj: " from $line.. but its aint work with a space on the end.. how do i do to remove it.
regsub -all "Soundic-radio dj: " $line "" line
do not work..
regsub -all "Soundic-radio dj:" $line "" line
works but then the space still there.
l
loze
Post
by loze » Thu May 23, 2002 11:27 am
oops, sorry it works after a restart
l
loze
Post
by loze » Thu May 23, 2002 11:43 am
but i have an other problem.
why doesnt & replace with & in this regsub??
regsub -all "&" $line "&" line
Petersen
Owner
Posts: 685 Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK
Post
by Petersen » Thu May 23, 2002 3:12 pm
because of the way it handles & in regexp matching
regsub -all "&" $line "\&" line
is what you need
l
loze
Post
by loze » Thu May 23, 2002 4:07 pm
why just three signs ??
Petersen
Owner
Posts: 685 Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK
Post
by Petersen » Thu May 23, 2002 8:45 pm
because the expression is expanded twice when evaluated, thus you've gotta escape the thats escaping the &, and thus escape the thats escaping the , so you end up with 3
l
loze
Post
by loze » Fri May 24, 2002 8:55 am
ok, thanks for helping.