On Tue, 10 Sep 2002, Barlow, Neil wrote:
Hi all,
I am dealing with directories and I read somewhere that it is best to use /
rather than \ when dealing with directories. In order to cover my back - I
am attempting to parse the string and replace any \ with / using the
following:
print
On 10/09/2002 15:55:14 perl-win32-users-admin wrote:
oops, do that and you'll confuse it. swap that for
$dir=~s'\'/'g; #not interpolated with single quotes
Huh? I've never heard of that. It doesn't work for me either. What version
of Perl are you using, and where is this documented?
The
\A
Can anyone advise on what I am doing wrong?
I really really really appreaciate your help with this..
Regards,
Neil Barlow
-Original Message-
From: Stovall, Adrian M. [mailto:[EMAIL PROTECTED]]
Sent: 10 September 2002 15:15
To: Barlow, Neil
Subject: RE: Regualr Expression
You're missing
: Barlow, Neil [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 8:38 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Regualr Expression Again...
Thanks for your input for the last question.
I am trying to complete a pattern match (Determining if the string ends
in a
forward slash) and can't get
PROTECTED]
Subject: RE: Regualr Expression Again...
It almost looks like you're working on a backslash, not a forward slash
- which did you intend? I presume that's all you want to match, you are
ONLY looking for the forward slash on the end of the line?
$scandir=~/\/$/;
or my preference,
$scandir
On 11/09/2002 14:53:05 Barlow, Neil wrote:
I am looking to match \ at the end of the line -
Have tried $scandir=~/\\$/ and am still not getting a match
My input is C:\
Run your script with
perl -Mre=debug yourscript.pl
That will show you what the regular expression engine is doing
(make
PROTECTED]]
Sent: Wednesday, September 11, 2002 8:53 AM
To: 'Gould, Kevin'; [EMAIL PROTECTED]
Subject: RE: Regualr Expression Again...
Appollogies -
I am looking to match \ at the end of the line -
Have tried $scandir=~/\\$/ and am still not getting a match
My input is C:\
Thanks for your help
Barlow, Neil wrote, on Wednesday, September 11, 2002 9:53 AM
: I am looking to match \ at the end of the line -
: Have tried $scandir=~/\\$/ and am still not getting a match
: My input is C:\
perl -e $r=qq(c:\\);print qq(yay\n) if ($r=~/\\$/);
prints yay; same if $r=qq(c:\\\n). (Someone
Isn't the C Prompt usually c:\?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Joseph P. Discenza
Sent: Wednesday, September 11, 2002 9:30 AM
To: Barlow, Neil; 'Gould, Kevin';
[EMAIL PROTECTED]
Subject: RE: Regualr Expression Again...
Barlow, Neil
Please ignore my previous post and my most recent lapse in useful
thought...
-Original Message-
From: Joseph P. Discenza [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 9:30 AM
To: Barlow, Neil; 'Gould, Kevin';
[EMAIL PROTECTED]
Subject: RE: Regualr Expression Again
Hi all,
I am dealing with directories and I read somewhere that it is best to use /
rather than \ when dealing with directories. In order to cover my back - I
am attempting to parse the string and replace any \ with / using the
following:
print Please enter directory to search: ; #
, September 10, 2002 9:05 AM
To: [EMAIL PROTECTED]
Subject: Regualr Expression
Hi all,
I am dealing with directories and I read somewhere that it is best to
use / rather than \ when dealing with directories. In order to cover my
back - I am attempting to parse the string and replace any \ with /
using
Try this:
$dir =~ s/\//\\/g;
Barlow, Neil [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
09/10/2002 09:05 AM
To:[EMAIL PROTECTED]
cc:
Subject:Regualr Expression
Hi all,
I am dealing with directories and I read somewhere that it is best to use /
rather
The problem here
$dir =~ s/\///g;
is that the two characters you are dealing with have special meaning. The
/ is interpreted as a quote delimiter because you are using s///. The
strings inside of s/// are interpolated, so the \ is interpreted as an
escape character. Try escaping both
Hi all,
I am dealing with directories and I read somewhere that it is best to use /
rather than \ when dealing with directories. In order to cover my back - I
am attempting to parse the string and replace any \ with / using the
following:
print Please enter directory to search: ;# directory
$dir=~s!\!/!g; #should work better, no ambiguity with slashes
oops, do that and you'll confuse it. swap that for
$dir=~s'\'/'g; #not interpolated with single quotes
~or~
$die=~s!\\!/!g;
that'll teach me
_
Send and receive
oops, do that and you'll confuse it. swap that for
$dir=~s'\'/'g; #not interpolated with single quotes
Huh? I've never heard of that. It doesn't work for me either. What version
of Perl are you using, and where is this documented?
--
Mark Thomas[EMAIL PROTECTED]
On 10/09/2002 15:37:44 perl-win32-users-admin wrote:
$dir=~s!\!/!g; #should work better, no ambiguity with slashes
oops, do that and you'll confuse it. swap that for
$dir=~s'\'/'g; #not interpolated with single quotes
~or~
$die=~s!\\!/!g;
There's also: $die =~ tr!\\!/!;
--
Csaba
oops, do that and you'll confuse it. swap that for
$dir=~s'\'/'g; #not interpolated with single quotes
Huh? I've never heard of that. It doesn't work for me either. What version
of Perl are you using, and where is this documented?
Hmm, it doesn't work either. meh. there's something
$die=~s!\\!/!g;
There's also: $die =~ tr!\\!/!;
err, yes... there seems to be something wrong with the auto-correct in my
fingers, I'll have to look into them. 8^)
_
Chat with friends online, try MSN Messenger:
Cheers,
Can the regex expression below then be modified to find out if the number of
slashes in the expression is greater than one?
-Original Message-
From: Stovall, Adrian M. [mailto:[EMAIL PROTECTED]]
Sent: 10 September 2002 15:16
To: perl-win32-users
Subject: Regualr Expression
.
-Original Message-
From: Barlow, Neil [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 10:11 AM
To: perl-win32-users
Subject: RE: Regualr Expression
Cheers,
Can the regex expression below then be modified to find out if the
number of slashes in the expression is greater than one
22 matches
Mail list logo