Hi Barry,
On Thu, Nov 10, 2011 at 2:34 AM, Barry Brevik wrote:
> Below is some test code that will be used in a larger program.
>
> In the code below I have a regular expression who's intent is to look
> for " <1 or more characters> , <1 or more characters> " and replace the
> comma with |. (the
estate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Barry
Brevik
Sent: Wednesday, November 09, 2011 5:35 PM
To: perl Win32-users
Subject: Problem with regex
Below is some test code that will be used in a larger program.
What I am trying to do is process lines from a
Below is some test code that will be used in a larger program.
What I am trying to do is process lines from a CSV file where some of
the 'cells' have commas embedded in the (see sample code below). I might
have used text::CSV but as far as I can tell that module also can not
deal with embedded com
> use strict;
> use warnings;
>
> my $Data = 'Hello, i am a litte String.$ Please format me.$$$
> I am the end of the String.$$ And i am the last!';
>
> $Data =~ s/([^\$]*)\${3,3}([^\$]+)/$1\\$2/gm;
> $Data =~ s/([^\$]*)\${2,2}([^\$]+)/$1\$2/gm;
> $Data =~ s/([^\$]*)\${1,1}([^\$]+)/$1\$2/gm;
> p
At 09:47 AM 5/12/2006, Yekhande, Seema \(MLITS\) wrote:
Holger,
Actually $ is a special character in string in perl. So, if the $ is
there in the input,
you will have to always write it with the leading escape character.
So, make your input will be like this,
my $data = "Hello, i am a litte S
Holger,
This worked for me note that you need to escape the $ characters in your string. The "3398" number is actually the PID of the perl process returned from the special variable $$ ... since you didn't escape the $ characters..
my $Data = "" i am a litte String.\$ Please format me.\$\
The code below worked for me, after using single
quotes around the original string to prevent any
interpolation (it's always a good practice to
print out the original string to verify that it's
what you thought it was), and, of course, $Data is not the same as $data.
At 08:38 AM 5/12/2006, Ho
tring.$$ And i am the last!";
It will solve your problem.
Thanks,
Seema
GPCT|TDDS|AIS|SPCM3
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Holger Wöhle
Sent: Friday, May 12, 2006 6:09 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Problem
Hello,
my $Data = "Hello, i am a litte String.$ Please format me.$$$ I am the end
of the String.$$ And i am the last!"
The regex should replace $ with the string , $$ with and $$$ with
(please don't think about the why)
If tried to use the following:
$data =~ s/\$\$\$//gm; #should catch eve
Hello,
under Windows with ActiveState Perl i have a strange problem with a regex:
Assuming the following String:
my $Data = "Hello, i am a litte String.$ Please format me.$$$ I am the end
of the String.$$ And i am the last!"
The regex should replace $ with the string , $$ with and $$$ with
(p
10 matches
Mail list logo