ta == timothy adigun 2teezp...@gmail.com writes:
ta You can use unpack:
ta$val = 11.0.56.1;
ta$new_val=unpack(x5 A2,$val); # skip forward 6, get 2
ta print $new_val # print 56;
unpack would be a poor choice if the number of digits in a field
changes. pack/unpack are
ug == Uri Guttman u...@stemsystems.com writes:
ug unpack would be a poor choice if the number of digits in a field
ug changes. pack/unpack are meant for use in fixed field records.
That was a bad assumption on my side, I only considered the problem at
hand, thinking unpack will be faster
Hi Irfan,
On Sat, 10 Sep 2011 10:23:31 -0700 (PDT)
Irfan Sayed irfan_sayed2...@yahoo.com wrote:
hi,
i have following string.
$val = 11.0.56.1;
i need to write regular expression which should match only 56 and print
There are any number of ways to extract 56 using a regular
On 11-09-10 01:23 PM, Irfan Sayed wrote:
i have following string.
$val = 11.0.56.1;
i need to write regular expression which should match only 56 and print
please suggest
( $val =~ /(56)/ ) print $1;
--
Just my 0.0002 million dollars worth,
Shawn
Confusion is the first step of
On 10/09/2011 18:23, Irfan Sayed wrote:
hi,
i have following string.
$val = 11.0.56.1;
i need to write regular expression which should match only 56 and print
please suggest
I think you should forget about regular expressions and use split:
my $sub = (split /\./, $val)[2];
HTH,
Hi Irfan,
You can use unpack:
$val = 11.0.56.1;
$new_val=unpack(x5 A2,$val); # skip forward 6, get 2
print $new_val # print 56;
jet speed wrote:
Guys,
Hello,
I am new to perl, I am having trouble capturing the required output from
the command, with my limited knowlege i tried to put something togather. not
sure how to proceed beyond.
In a regular expression, when you want to capture part of a pattern you
have to
On Mon, Aug 3, 2009 at 4:00 PM, John W. Krahn jwkr...@shaw.ca wrote:
jet speed wrote:
Guys,
Hello,
I am new to perl, I am having trouble capturing the required output from
the command, with my limited knowlege i tried to put something togather.
not
sure how to proceed beyond.
In a
jet speed wrote:
Hi John, Thanks for your help, Much appreciated. Please could you also
refer any good reference for Regular expression for a beginer like me, would
be great.
Have you read the documentation that comes with Perl?
perldoc perlrequick
perldoc perlretut
perldoc perlre
John
On Mon, Aug 3, 2009 at 5:45 PM, John W. Krahn jwkr...@shaw.ca wrote:
jet speed wrote:
Hi John, Thanks for your help, Much appreciated. Please could you also
refer any good reference for Regular expression for a beginer like me,
would
be great.
Have you read the documentation that comes
jet speed wrote:
On Mon, Aug 3, 2009 at 5:45 PM, John W. Krahn jwkr...@shaw.ca wrote:
jet speed wrote:
Hi John, Thanks for your help, Much appreciated. Please could you also
refer any good reference for Regular expression for a beginer like me,
would
be great.
Have you read the
--- Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote:
Hi All,
I have a string like this
CLEARCASE_CMDLINE = (mkact -nc notme sprint) Now with the regular
expression what I want is only those characters before closing
braces
excluding white space character. I mean to say that if regular
On Dec 13, 2007 6:12 AM, Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote:
Hi All,
I have a string like this
CLEARCASE_CMDLINE = (mkact -nc notme sprint) Now with the regular
expression what I want is only those characters before closing braces
excluding white space character. I mean to say
Sayed, Irfan (Irfan) wrote:
Hi All,
I have a string like this
CLEARCASE_CMDLINE = (mkact -nc notme sprint) Now with the regular
expression what I want is only those characters before closing braces
excluding white space character. I mean to say that if regular
expression encounter the
To: beginners@perl.org Perl Beginners
Cc: Sayed, Irfan (Irfan)
Subject: Re: Help on regular expression
Sayed, Irfan (Irfan) wrote:
Hi All,
I have a string like this
CLEARCASE_CMDLINE = (mkact -nc notme sprint) Now with the regular
expression what I want is only those characters before closing
Sayed, Irfan (Irfan) wrote:
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sayed, Irfan (Irfan) wrote:
Hi All,
I have a string like this
CLEARCASE_CMDLINE = (mkact -nc notme sprint) Now with the regular
expression what I want is only those characters before closing braces
excluding white
Irfan J Sayed wrote:
Hi ,
Hello,
I am using following code
#!/usr/local/bin/perl
# Main program
use warnings;
use strict;
my $file = c:\backup.pl;
The escape sequence \b represents the backspace character. You probably want:
my $file = 'c:/backup.pl';
open(FH,$file) ||
Hi Irfan,
On 6/1/06, Irfan J Sayed [EMAIL PROTECTED] wrote:
Hi ,
I am using following code
#!/usr/local/bin/perl
# Main program
use warnings;
use strict;
my $file = c:\backup.pl;
open(FH,$file) || die can't open a file;
my $pattern = '\w\s\w';
my $input = ;
print yes got the match
Irfan J Sayed schreef:
#!/usr/local/bin/perl
use warnings;
use strict;
Good!
my $file = c:\backup.pl;
Use
my $file = 'c:\backup.pl';
or rather
my $file = 'c:/backup.pl';
open(FH,$file) || die can't open a file;
Make that:
open my $fh, '', $file or die Error opening
Irfan J Sayed wrote:
Hi ,
I am using following code
#!/usr/local/bin/perl
# Main program
use warnings;
use strict;
my $file = c:\backup.pl;
open(FH,$file) || die can't open a file; [...]
For the die statement, use this instead:
die can't open this file: $file reason: $!;
Your
David Romano schreef:
[ $pattern = '\w\s\w' ]
You also need to [...] escape the slashes for the pattern you're
using
I don't think that is needed:
(1) perl -le '$re = q{\w\s\w} ; print qr/$re/'
(2) perl -le '$re = q{\\w\\s\\w} ; print qr/$re/'
(on Windows you'll need to change the outer
Hi Ruud,
On 6/1/06, Dr.Ruud [EMAIL PROTECTED] wrote:
David Romano schreef:
[ $pattern = '\w\s\w' ]
You also need to [...] escape the slashes for the pattern you're
using
I don't think that is needed:
(1) perl -le '$re = q{\w\s\w} ; print qr/$re/'
(2) perl -le '$re = q{\\w\\s\\w} ;
Madhu Reddy wrote:
Hi,
I need some help on regular expression...
i have following in variable $total_count
$total_count = ##I USBP 01 10:38:09(000)
xyz_abc_etrack_validation,6 ETRACK_TOTAL_RECS : 100
Here in this ETRACK_TOTAL_RECS is fixed and common for
all and rest is
Hi,
I need some help on regular expression...
i have following in variable $total_count
$total_count = ##I USBP 01 10:38:09(000)
xyz_abc_etrack_validation,6 ETRACK_TOTAL_RECS : 100
Here in this ETRACK_TOTAL_RECS is fixed and common for
all and rest is changing...
like following
On Tue, Jan 27, 2004 at 07:49:02AM -0800, Madhu Reddy ([EMAIL PROTECTED]) wrote:
Hi,
I need some help on regular expression...
i have following in variable $total_count
$total_count = ##I USBP 01 10:38:09(000)
xyz_abc_etrack_validation,6 ETRACK_TOTAL_RECS : 100
Here in this
Hi,
$total_count =~ s/.+ : (\d+)/$1/;
HTH,
Jan
Madhu Reddy wrote:
Hi,
I need some help on regular expression...
i have following in variable $total_count
$total_count = ##I USBP 01 10:38:09(000)
xyz_abc_etrack_validation,6 ETRACK_TOTAL_RECS : 100
Here in this ETRACK_TOTAL_RECS is
On Tue, 27 Jan 2004, Madhu Reddy wrote:
Hi,
I need some help on regular expression...
i have following in variable $total_count
$total_count = ##I USBP 01 10:38:09(000)
xyz_abc_etrack_validation,6 ETRACK_TOTAL_RECS : 100
Here in this ETRACK_TOTAL_RECS is fixed and common for
all
Try this if you want regex.
This may not be the appropriate but works.
@list = ('1992','1993 (summer)','1995 fall');
foreach (@list) {
push @array, $1 if $_ =~ /(\d+)\s*.*$/;
}
print map {$_,\n} @array;
regards
Rajendran
Burlingame,CA
- Original Message -
From: Shaun Bramley
Nope..this won't work. Why don't you loop over the list and do a substring or pack as
you know that you need to keep only the first 4 characters of each element?
-Original Message-
From: Shaun Bramley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 4:24 PM
To: [EMAIL
-Original Message-
From: Shaun Bramley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 4:24 PM
To: [EMAIL PROTECTED]
Subject: Help with regular expression
Hi all,
I'm just looking for some confirmation on my regx.
I have a list ('1992', '1993 (summer)',
Shaun Bramley wrote:
Hi all,
I'm just looking for some confirmation on my regx.
I have a list ('1992', '1993 (summer)', '1995 fall') and what I want to do
is keep only the first four characters. Will the regx work for me?
@list =~ s/\s*//;
Again will that turn the list into (1992,
Shaun Bramley wrote at Wed, 25 Sep 2002 22:24:00 +0200:
I'm just looking for some confirmation on my regx.
I have a list ('1992', '1993 (summer)', '1995 fall') and what I want to do
is keep only the first four characters. Will the regx work for me?
@list =~ s/\s*//;
Again will that
At 15:49 2002.06.05, Ankit Gupta wrote:
Hello,
I am facing a problem in using regular expression on array. My code is
written below:
open(FILE, $dirvalue) ;
my @lines = FILE;
print @lines; # prints the file contents
if( @lines =~ m/Date:/) { print
-Original Message-
From: Ankit Gupta [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 3:49 PM
To: [EMAIL PROTECTED]
Subject: Help in Regular expression with array
Hello,
I am facing a problem in using regular expression on array. My code is
written below:
Hi -
I don't think you can regex on a whole array; try this
after you have loaded the array:
for (@lines) {print ok if /Date:/; }
This iterates the array lines presenting $_ for each
iteration. The regex /Date:/ operates on $_.
Aloha = Beau.
-Original Message-
From:
Don't know if you can do a search on an array (until and unless you want to evaluate
each element)
In case you are trying to achieve the multiple lines search, maybe this or the 2nd
example can help :
open (FILE , $ARGV[0]);
my @lines = FILE;
close(FILE);
$line = join( , @lines);
At 16:12 2002.06.05, Shishir K. Singh wrote:
open (FILE , $ARGV[0]);
print ok if ( map { /Date:/ } (FILE) );
close FILE;
map return an array with the result of the express apply to each line. Even if none of
the lines in FILE contain Date:, you will have an array with one value for each
!!
-Original Message-
From: Eric Beaudoin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 4:29 PM
To: Shishir K. Singh
Cc: Ankit Gupta; [EMAIL PROTECTED]
Subject: RE: Help in Regular expression with array
At 16:12 2002.06.05, Shishir K. Singh wrote:
open (FILE , $ARGV[0]);
print ok
]
Subject: RE: Help in Regular expression with array
Beau..I guess , the evaluation of the expression is not going to be true if
no Date: is found. Since map returns a list consisting of the results of
each successive evaluation of the expression..., the map will return undef.
Although, here..I
You forgot to add g (global)in the end...
$dirstruct =~ s/([\W])/-/g;
Cheers
Shishir
-Original Message-
From: Ankit Gupta [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 10:53 AM
To: [EMAIL PROTECTED]
Subject: help in regular expression
Hello Friends,
I need help in the below
On May 31, Ankit Gupta said:
$dirstruct =~ s/([\W])/-/;
You're missing the /g modifier. And s/([\W])/-/g could be written as
s/\W/-/g and would be a bit more efficient.
--
Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734
You are looking for the word addr: followed by four groups of digits, three
of which are separated by a dot. Therefore you want
$string =~ /addr:(\d+\.\d+.\d+\.\d+)/;
Now, $1 has the correct ip address.
-Original Message-
From: Daniel Falkenberg
To: [EMAIL PROTECTED]
Sent: 10/4/2001
42 matches
Mail list logo