Re: Removing strings

2003-01-13 Thread Rob Dixon
Hi "Dan" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > OK, that worked fine, until a \ character was introduced into the variable > which contains the information to be removed, for example, #blah\ > > I tried both john's & rob's methods, both crashed the serv

Re: Removing strings

2003-01-13 Thread dan
OK, that worked fine, until a \ character was introduced into the variable which contains the information to be removed, for example, #blah\ I tried both john's & rob's methods, both crashed the service. Any clues? Cheers. -- dan Network Administrator and Head Coder http://www.abovenet.org IRC Ne

Re: Removing strings

2003-01-13 Thread Rob Dixon
Hi Dan "Dan" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm assuming that yours rob will just remove the #ba, without the space. > While this was what I was originally looking for, John's solution removing > the #ba and the space before is more convenient,

Re: Removing strings

2003-01-13 Thread dan
I'm assuming that yours rob will just remove the #ba, without the space. While this was what I was originally looking for, John's solution removing the #ba and the space before is more convenient, saves me having to do s/ / /g; then. dan Network Administrator & Head Coder http://www.abovenet.org

Re: Removing strings

2003-01-13 Thread Rob Dixon
"John W. Krahn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > This will work but it will also remove the space in front of the match: > > s/(\s|^)#ba(?=\s|$)//; > s/((?<=\s)|^)#ba(?=\s|$)//; /R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: Removing strings

2003-01-12 Thread John W. Krahn
Dan wrote: > > "John W. Krahn" <[EMAIL PROTECTED]> wrote in message > > > > You need to use the \b word boundary zero-width assertion. > > > > $variable =~ s/\b\Q$remove\E\b//g; > > Moving on, same subject/problem, but slightly different scenario.. > In my next variable $variable2, i have entries

Re: Removing strings

2003-01-12 Thread dan
Moving on, same subject/problem, but slightly different scenario.. In my next variable $variable2, i have entries: $variable2 = "#ha #bad #cod #ba #dog"; Basically, i want to be able to remove #ba, without removing #ba from #bad, so it ends up: $variable2 = "#ha #bad #cod #dog"; This also needs

Re: Removing strings

2003-01-12 Thread dan
Excellent, worked! Cheers Dan "John W. Krahn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Dan wrote: > > > > Hey, I have a slight dilemma which i'm struggling to overcome. Wondering if > > anyone has any ideas on this.. > > > > I have a variable, for examp

Re: Removing strings

2003-01-12 Thread John W. Krahn
Dan wrote: > > Hey, I have a slight dilemma which i'm struggling to overcome. Wondering if > anyone has any ideas on this.. > > I have a variable, for example's sake, say $variable. $variable has a load > of entries. > > $variable = "danneh blah dan etc danster"; > > What i want to do, without