$Bill Luebkert wrote:
Richard A. Wells wrote:
[...]
The _expression_
$path_elem =~ s{(\s)}{\\$1}gio;
The /io is not needed/wanted.
Right about the /i. That's conventional laziness on my part, as it is
usually what I want, though it would be detrimental in this
Richard A. Wells wrote:
> $Bill Luebkert wrote:
>> Richard A. Wells wrote:
>>
>>> [...]
>>>
>>> The expression
>>>
>>> $path_elem =~ s{(\s)}{\\$1}gio;
>>>
>>
>> The /io is not needed/wanted.
>>
> Right about the /i. That's conventional laziness on my part, as it is
> usually what I w
Richard A. Wells wrote:
> On UNIX you have to escape the whitespace, e.g.
>
> /this path/has spaces
>
> would become
>
> /this\ path/has\ spaces
>
> The expression
>
> $path_elem =~ s{(\s)}{\\$1}gio;
The /io is not needed/wanted.
> should do the trick.
>
> Note that I used {} d
On UNIX you have to escape the whitespace, e.g.
/this path/has spaces
would become
/this\ path/has\ spaces
The expression
$path_elem =~ s{(\s)}{\\$1}gio;
should do the trick.
Note that I used {} delimiters (i.e. s{}{}) to make it clearer, since
the data itself contains /s and som
On UNIX you have to escape the whitespace, e.g.
/this path/has spaces
would become
/this\ path/has\ spaces
The expression
$path_elem =~ s{(\s)}{\\$1}gio;
should do the trick.
Note that I used {} delimiters (i.e. s{}{}) to make it clearer, since
the data itself contains /s and someone might
Hi All,
I am meeting a problem on a regular expression.
My code is like:
$path_elem = "$ENV{'CLEARCASE_PN'}";
The return value of $path_elem is either
$path_elem = /ccstore/test/test.pl
Or $path_elem = /ccstore/test 1/test 1.pl # there is a space in the
path name including the file name too
$Bill Luebkert graced perl with these words of wisdom:
>>>B. I want to get 1.62 from the string, how can I do it?
>>
>>
>> Nobody seems to have answered part B.
>
> Actually they did. Sam's for one :
>
> $string = "sct-1.62-1";
> print "$1\n" if ($string =~ /^.+-(.+)-.+$/);
You mean $1 capt
Ted Schuerzinger wrote:
> Cai, Lixin (L.) graced perl with these words of wisdom:
>
>
>>My $string = "sct-1.62-1";
>>
>>I have 2 regular expression question here,
>>
>>A. I want to check whether the format is "XXX-XXX-XXX", how can I do it?
This format doesn't actually match the example given.
Cai, Lixin (L.) graced perl with these words of wisdom:
> My $string = "sct-1.62-1";
>
> I have 2 regular expression question here,
>
> A. I want to check whether the format is "XXX-XXX-XXX", how can I do it?
> B. I want to get 1.62 from the string, how can I do it?
Nobody seems to have answere
Title: Message
or
even. . .
$string = "sct-1.62-1";print
"$1\n" if ($string =~ /^.+-(.+)-.+$/);
(no
need to use the backslash escape for the dashes; they're not part of a character
class. . .
Sam
Gardner
GTO Application Development
Title: A regular expression question
Your format does not match XXX-XXX-XXX so I'll guess you mean three
fields delimited by a dash.
here's one way to do it
$string = "sct-1.62-1";
print "$1\n" if ($string =~ /^.+\-(.+)\-.+$/)
-Origina
Title: A regular expression question
Now I have a string like
My $string = "sct-1.62-1";
I have 2 regular _expression_ question here,
A. I want to check whether the format is "XXX-XXX-XXX", how can I do it?
B. I want to get 1.62 from the string, how can I do i
while (<>) {
if ( /^#/ ){
print;
}
}
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 3:12 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: A regular expression question
r 12, 2002 3:12 PM
>To: [EMAIL PROTECTED];
>[EMAIL PROTECTED];
>[EMAIL PROTECTED]
>Subject: A regular expression question
>
>
>I have a cron file which the line looks like this:
>
>00 22 * * * perl -S queue_submit.pl esd-foundry "perl -S host-scrubber.pl"
>#bui
Cai_lixin wrote:
> I want to get the comment after # of each line(not including
> "#"), how could I do this?
Depends. If you might have a # in a command, you'll want everything after
the last #. If you're more likely to have another # in a comment, you want
everything after the first #. (if you
At 03:11 PM 9/12/2002 -0400, [EMAIL PROTECTED] wrote:
>I have a cron file which the line looks like this:
>
>00 22 * * * perl -S queue_submit.pl esd-foundry "perl -S host-scrubber.pl"
>#build host scrubber
>30 22 * * * perl -S queue_submit.pl esd-foundry "perl -S group-scrubber.pl"
>#build group s
ROTECTED]]
Sent: Thursday, September 12, 2002 12:12 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: A regular expression question
I have a cron file which the line looks like this:
00 22 * * * perl -S queue_submit.pl esd-foundry "perl -S host-scrubber.pl"
#
[EMAIL PROTECTED] wrote, on Thursday, September 12, 2002 3:12 PM
: I have a cron file which the line looks like this:
:
: 00 22 * * * perl -S queue_submit.pl esd-foundry "perl -S host-scrubber.pl"
: #build host scrubber
: 30 22 * * * perl -S queue_submit.pl esd-foundry "perl -S
: group-scrubber.
Title: RE: A regular expression question
foreach my $line ()
{
my ($comment) = $line =~ /^\#(.*)$/;
}
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 15:12
> To: [EMAIL PROTECTE
I have a cron file which the line looks like this:
00 22 * * * perl -S queue_submit.pl esd-foundry "perl -S host-scrubber.pl"
#build host scrubber
30 22 * * * perl -S queue_submit.pl esd-foundry "perl -S group-scrubber.pl"
#build group scrubber
30 22 * * * perl -S queue_submit.pl esd-foundry "per
20 matches
Mail list logo