Thank you Michael. I missed the "\".Works fine now.
----- Original Message -----
From: "Michael Kelly" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 16, 2001 9:43 AM
Subject: Re: s/^W+//;
> On 8/15/01 4:28 PM, Clinton wrote:
>
> > Hi
> > I'm reading data from MSAccess, joining 2 fetched values with a comma
and
> > writing to another table. The data seems to be padded. My resultant
column
> > shows some space between the two values eg
> > valuefromFirstcolumn , valuefromSecondcolumn
> >
> > I have tried applying a regex
> > $valuefromFirstcolumn =~s/W+$//;
> > &
> > $valuefromFirstcolumn =~s/s+$//;
> > with no success.
> > Assistance appreciated.
> > Regards
> > CCJ
> >
>
> Erm, you want to remove W's and S's at the end of $valuefromFirstcolumn?
If
> you're trying to remove all non-word characters, you'd say:
>
> $valuefromFirstcolumn =~s/\W+//g;
>
> But I don't think that's what you want, as you'd end up with
>
> valuefromFirstcolumnvaluefromSecondcolumn
>
> from your example. I'm not sure quite what you want, but you might want to
> try
>
> $valuefromFirstcolumn =~s/\s+//g;
>
> which should be self explanatory.
>
> I recommend buying and reading the camel book ("Programming Perl, 3rd
ed.",
> by Larry Wall, Tom Christiansen, and Jon Orwat). It has a nice big chapter
> on regexes.
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]