On Sun, Feb 10, 2013 at 8:05 AM, Chris Stinemetz
wrote:
> To take this a step further.
>
> How would you go about creating a hash to sum up all the values in group
> $3 utilizing the flip/flop operator and print the results of the key and
> value with the key being group $2?
>
>
This is what I cam
To take this a step further.
How would you go about creating a hash to sum up all the values in group $3
utilizing the flip/flop operator and print the results of the key and value
with the key being group $2?
Thank you,
Chris
while( ) {
if ( /0x3\|68\|/ .. /^#END/ ) {
print if /\|
Thank you everyone for you help.
-Chris
On Sat, Feb 9, 2013 at 5:15 PM, Uri Guttman wrote:
> On 02/09/2013 03:59 PM, John W. Krahn wrote:
>
>
>> Let's re-factor that down to its essence:
>>
>> while ( ) {
>> print if /\|68\|/;
>> print "$1\t$2\t$3\n" if /(\|\d)\|(\d+)\|(\d+)/;
>>
On 02/09/2013 03:59 PM, John W. Krahn wrote:
Let's re-factor that down to its essence:
while ( ) {
print if /\|68\|/;
print "$1\t$2\t$3\n" if /(\|\d)\|(\d+)\|(\d+)/;
}
Now we need to add something that starts at |68| and stops at #END:
while ( ) {
if ( /\|68\|/ .. /^#EN
Hi,
On Sat, Feb 9, 2013 at 6:06 PM, Chris Stinemetz wrote:
> I would like to only work with the data that has a line with |68| in it
>
Does it mean even, that |68| can be anyway in the your data before any of
the #END is reached?
If yes, then I think you have been given a good solution. If not,
Chris Stinemetz wrote:
I would like to only work with the data that has a line with |68| in it
print that line and then print each subsequent lines in that match
/\|7\|\d+\|\d+/ until #END is reached and then repeat for the rest of the
input data.
Below is what I have attempted.
Thanks in adva
On Sat, 9 Feb 2013 11:06:46 -0600
Chris Stinemetz wrote:
> I would like to only work with the data that has a line with |68| in
> it print that line and then print each subsequent lines in that match
> /\|7\|\d+\|\d+/ until #END is reached and then repeat for the rest of
> the input data.
OTTOMH
On 2012-08-20 00:18, John W. Krahn wrote:
print map exists $stud{ $_ } ? "$_ = $stud{ $_ }\n" : (), @names;
A map using a ternary with (), is like a grep:
print "$_ = $stud{ $_ }\n" for grep exists $stud{ $_ }, @names;
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For
Hi Andy,
On 8/20/12, Andy Bach wrote:
> On Sun, Aug 19, 2012 at 4:48 PM, timothy adigun <2teezp...@gmail.com>
> wrote:
>> foreach my $match_value ( sort keys %stud ) {
>> print $match_value, "=", $stud{$match_value},
>> $/ if $match_value ~~ @names;
>> }
>
> "smart match" is a Perl
Hi,
> Hi Tim,
>
> Thanks, i tried to run the code, but get the error as below. Any thing i am
> missing line 17.
What version of Perl are you using?
For smart matching to work you must have Perl 5.10.1 Up (the 5.10.0
version behaved differently).
> syntax error at ./match2.pl line 17, near "$m
The "smart match" operator (~~) was introduced in Perl 5.10. If you are using a
Perl earlier than that, you will get a syntax error.
See
perldoc perl5100delta
perldoc perlsyn
and search for "Smart".
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: b
On Sun, Aug 19, 2012 at 4:48 PM, timothy adigun <2teezp...@gmail.com> wrote:
> foreach my $match_value ( sort keys %stud ) {
> print $match_value, "=", $stud{$match_value},
> $/ if $match_value ~~ @names;
> }
"smart match" is a Perl 6 (though it probably back ported to a Perl 5
modul
Thanks John, worked as a treat. Appreciate it.
On Sun, Aug 19, 2012 at 11:18 PM, John W. Krahn wrote:
> jet speed wrote:
>
>> Hi All,
>>
>
> Hello,
>
>
> Is there a way to find matching array elements from hash.
>>
>> ex:
>>
>> @names = ( abc. def. ghi, jky; );
>>
>> %stud = (
>> " abc" =>"
On Sun, Aug 19, 2012 at 10:48 PM, timothy adigun <2teezp...@gmail.com>wrote:
> Hi,
>
> Please, Check my comments below.
>
> On 8/19/12, jet speed wrote:
> > Hi All,
> >
> > Is there a way to find matching array elements from hash.
> >
> > ex:
> >
> > @names = ( abc. def. ghi, jky; );
>
> The a
jet speed wrote:
Hi All,
Hello,
Is there a way to find matching array elements from hash.
ex:
@names = ( abc. def. ghi, jky; );
%stud = (
" abc" =>" 34",
"nba" =>"99",
"def" =>"24",
"ghi"=> "33");
How can i go throught each elements of has %stud and print the matching
array value in th
Hi,
Please, Check my comments below.
On 8/19/12, jet speed wrote:
> Hi All,
>
> Is there a way to find matching array elements from hash.
>
> ex:
>
> @names = ( abc. def. ghi, jky; );
The above should be @names=("abc","def","ghi","jky");
OR
@names=qw(abc def ghi jky); OR other variant
ey occur in two unique formats throughout the whole document (which
should match \w- and -\w- ).
Thomas
Van: Brian Fraser [frase...@gmail.com]
Verzonden: donderdag 29 september 2011 16:59
Aan: John Delacour
CC: beginners@perl.org
Onderwerp: Re: Matching G
At 17:29 -0300 29/9/11, Brian Fraser wrote:
On Thu, Sep 29, 2011 at 4:03 PM, John Delacour wrote:
Nitpick: Why the upper-case charset name?
Uppercase is UTF-8-strict, while lowercase is the lax version that
perl uses internally. Unless you are passing data from one perl
program to anothe
On Thu, Sep 29, 2011 at 4:03 PM, John Delacour wrote:
>
>
Nitpick: Why the upper-case charset name?
>
Uppercase is UTF-8-strict, while lowercase is the lax version that perl uses
internally. Unless you are passing data from one perl program to another,
and you are using illegal-UTF8-but-legal-UT
At 11:59 -0300 29/9/11, Brian Fraser wrote:
On Thu, Sep 29, 2011 at 10:58 AM, John Delacour
wrote:
use encoding 'utf-8';
Nitpick: Please don't use this, as encoding is broken. use utf8; and
use open qw< :std :encoding(UTF-8) >; should make do for a
replacement.
Nitpick: Why the upper-c
On Thu, Sep 29, 2011 at 10:58 AM, John Delacour wrote:
> use encoding 'utf-8';
>
>
Nitpick: Please don't use this, as encoding is broken. use utf8; and use
open qw< :std :encoding(UTF-8) >; should make do for a replacement.
To the original poster, please note that there's a bit of a difference i
At 11:42 + 29/9/11, Hamann, T.D. (Thomas) wrote:
I need to write a regex that matches any single Greek letter
followed by a hyphen in a UTF-8 text file that is otherwise in
English.
How can I match the Greek alphabet (lower and upper case)?
#!/usr/local/bin/perl
use strict;
use utf8;
us
On Monday 27 September 2010 12:21:51 hpant pant wrote:
> Hi ,
> can anyone explain me, how below code works ,dealing with nested patterns.
> i am not able to understand the ((?:(?!BEGIN)(?!END).)*) part.
>
> while (s/BEGIN((?:(?!BEGIN)(?!END).)*)END//gs) {
> # do something with $1
>
Jim Gibson writes:
> The general advice is not to worry about execution time until it becomes an
> issue. In other words, just get your program to do what you want it to do,
> then try to speed it up only if it is taking too long.
With that in mind... I'm back to spinning through the second hash
On 4/29/10 Thu Apr 29, 2010 5:15 PM, "Harry Putnam"
scribbled:
>>
>> The braces ({}) mean that %data is a "hash-of-hashes", i.e., the values of
>> the elements of %data are references to hashes.
>
> Needless to say, I'm a bit confused here googling on `hash of
> hashes' has plenty of hits
Jim Gibson writes:
[...] thanks for the tips on timing
> The general advice is not to worry about execution time until it becomes an
> issue. In other words, just get your program to do what you want it to do,
> then try to speed it up only if it is taking too long.
That sound sensible.
[...]
On 4/29/10 Thu Apr 29, 2010 2:06 PM, "Harry Putnam"
scribbled:
> "John W. Krahn" writes:
>
> [...]
>
>>> In other words is the perl interpreter working harder in one case?
>>
>> Yes.
>
> Thanks. Do you have any idea how much worse it is?
>
> I ask because I have some old scripts that go
"John W. Krahn" writes:
[...]
>> In other words is the perl interpreter working harder in one case?
>
> Yes.
Thanks. Do you have any idea how much worse it is?
I ask because I have some old scripts that go spinning thru the whole
hash in that same way, that I should probably track down and ch
"Uri Guttman" writes:
> again, why the poor names? what is 'base'? how is 1 different than 2?
> you have yet to properly specify the PROBLEM. you keep talking about
Easy up a little Uri... I hadn't seen your post when I wrote that
response to John.
--
To unsubscribe, e-mail: beginners-unsubsc
Harry Putnam wrote:
I posted my effort at digging out the matches.
I see the way you did it, even though not the exact results I was
after is 100s of percent better way to write it.
I'm curious though if the overhead is different in your compact code
compared to mine. That is, if all that
> "HP" == Harry Putnam writes:
HP> "John W. Krahn" writes:
>>> I need to do some matching of filenames in two top level directories.
>>> We expect to find a number of cases where the endnames ($_) are the
>>> same in both hierarchies but the full name is different.
>>>
>>> base1
"John W. Krahn" writes:
>> I need to do some matching of filenames in two top level directories.
>> We expect to find a number of cases where the endnames ($_) are the
>> same in both hierarchies but the full name is different.
>>
>> base1/my/file
>> base2/my/different_path/file
This should h
> "HP" == Harry Putnam writes:
HP> I need to do some matching of filenames in two top level directories.
HP> We expect to find a number of cases where the endnames ($_) are the
HP> same in both hierarchies but the full name is different.
someone else mentioned this but endname and full
Harry Putnam wrote:
I need to do some matching of filenames in two top level directories.
We expect to find a number of cases where the endnames ($_) are the
same in both hierarchies but the full name is different.
base1/my/file
base2/my/different_path/file
I've made hashes of the file nam
2009/12/10 John W. Krahn :
> Noah wrote:
>>
>> Hi there,
>
> Hello,
>
>> I am hoping to figure out the best Way to write something. I have two
>> arrays @previous_hostnames and @hostnames.
>>
>> I want to figure out if there is at least one matching element in
>> @previous_hostnames that is found
Rafa? Pocztarski wrote:
I forgot to cc: the list...
2009/12/10 Noah :
I am hoping to figure out the best Way to write something. Â I have two
arrays @previous_hostnames and @hostnames.
I want to figure out if there is at least one matching element in
@previous_hostnames that is found in @hostn
> "N" == Noah writes:
N> Hi there,
N> I am hoping to figure out the best Way to write something. I have two
N> arrays @previous_hostnames and @hostnames.
N> I want to figure out if there is at least one matching element in
N> @previous_hostnames that is found in @hostnames.
N>
I forgot to cc: the list...
2009/12/10 Noah :
> I am hoping to figure out the best Way to write something. I have two
> arrays @previous_hostnames and @hostnames.
>
> I want to figure out if there is at least one matching element in
> @previous_hostnames that is found in @hostnames.
You can use
Noah wrote:
Hi there,
Hello,
I am hoping to figure out the best Way to write something. I have two
arrays @previous_hostnames and @hostnames.
I want to figure out if there is at least one matching element in
@previous_hostnames that is found in @hostnames.
my $found = map { my $x = $_;
Noah Garrett Wallach wrote:
Hi there Perl folks,
Hello,
Okay I am trying to figure this out.
I am trying to match the following:
$line = "blah&blah&blah"
so I have the following line to match that
$line =~ /((?:blah).*?){0,5}/;
But I want to capture "blah" in a variable like
$capture =
Noah Garrett Wallach wrote on Thu, 17 Sep 2009
13:23:37 -0700
>Hi there Perl folks,
>
>
>Okay I am trying to figure this out.
>
>I am trying to match the following:
>
>
>$line = "blah&blah&blah"
>
>
>so I have the following line to match that
>
>$line =~ /((?:blah).*?){0,5}/;
>But I want to captu
On Thu, Sep 17, 2009 at 16:23, Noah Garrett Wallach
wrote:
> Hi there Perl folks,
>
>
> Okay I am trying to figure this out.
>
> I am trying to match the following:
>
>
> $line = "blah&blah&blah"
>
>
> so I have the following line to match that
>
> $line =~ /((?:blah).*?){0,5}/;
> But I want to ca
Saturday, May 30, 2009 3:49 AM
To: Perl Beginners
Subject: Re: Matching Question
Farrell, Patrick wrote:
> This is roughly what I am trying to do. Surround lower case strings within a
> string with tags.
>
> ===
> $msgText=
Farrell, Patrick wrote:
Thanks.
What if I added numbers like this
$msgText =~ s!(?<= )([a-z,0-9]+)(?= )!$1!g;
Did you really want to include a comma as part of that character class?
But I didn't want a string of only numbers?
In the strings I waned, I know the first character would not be
Farrell, Patrick wrote:
This is roughly what I am trying to do. Surround lower case strings within a
string with tags.
===
$msgText="THIS IS MY test STRING";
$msgText =~ m/ [a-z]+ /; #or $msgText =~ /\s[a-z]+\s/;
if(defined($1)){
That
Jeff Westman wrote:
All,
Hello,
I know this has been asked many times, and I have read the documentation
("perldoc -q "matching over more than one line") and still can't make head
or tails out of this.
I have a problem where my pattern can be in one line, or span multiple
lines. This is wha
On Tue, Mar 17, 2009 at 13:55, Bob McConnell wrote:
> From: Chas. Owens
>>
>> Perl doesn't start having problems with files until you start getting
>> into areas that the OS has problems with those files. Your machine,
>> however, may have problems if it does not have enough memory. I
>> remembe
From: Chas. Owens
>
> Perl doesn't start having problems with files until you start getting
> into areas that the OS has problems with those files. Your machine,
> however, may have problems if it does not have enough memory. I
> remember working on a production machine that only had eight megab
On Tue, Mar 17, 2009 at 12:39, Jim Gibson wrote:
snip
> A file of length 10MB should be no problem for Perl.
snip
Perl doesn't start having problems with files until you start getting
into areas that the OS has problems with those files. Your machine,
however, may have problems if it does not ha
On 3/17/09 Tue Mar 17, 2009 8:45 AM, "Jeff Westman"
scribbled:
> All,
>
> I know this has been asked many times, and I have read the documentation
> ("perldoc -q "matching over more than one line") and still can't make head
> or tails out of this.
>
> I have a problem where my pattern can be
On Sun, 30 Nov 2008 02:51:57 +0200, Canol Gökel wrote:
> My problem is to match HTML tags with RegExp. I managed to match
> something like this, properly:
>
> la la la a paragraph bla bla bla another paragraph ya ya
> ya
>
> But when nested, there arises problems:
>
> a paragraph bla bla bla la
On Sun, 2008-11-30 at 02:51 +0200, Canol Gökel wrote:
> How can one write an expression to match always the most inner part? I
> couldn't write an expression like "match a non-greedy .* which
> does not have a inside.
>
You can't write a regular expression to do this. And no, I'm not going
to w
On Mon, Nov 3, 2008 at 13:16, Kent, Mr. John, Contractor, Code 7500
<[EMAIL PROTECTED]> wrote:
snip
> In the text document they are written as
>
> Deg = °
> Apostrophe (') = <92>
> Open quote (") = <93>
> Closed quote (") = <94>
snip
How are you viewing the file? Most likely the <92> notation
slow_leaner wrote:
On Oct 28, 2:51 pm, [EMAIL PROTECTED] (Andy Cravens) wrote:
-Original Message-
From: slow_leaner [mailto:[EMAIL PROTECTED]
Sent: Tue 10/28/2008 11:58 AM
To: [EMAIL PROTECTED]
Subject: matching elements from array and print the results line by line from
log file
Hi,
I
On Oct 28, 2:51 pm, [EMAIL PROTECTED] (Andy Cravens) wrote:
> -Original Message-
> From: slow_leaner [mailto:[EMAIL PROTECTED]
> Sent: Tue 10/28/2008 11:58 AM
> To: [EMAIL PROTECTED]
> Subject: matching elements from array and print the results line by line from
> log file
>
> Hi,
> I have
slow_leaner wrote:
Hi,
Hello,
I have a list of element in array that I would like to match the
pattern in logs file. I have hard time take element from array and
matching it. More then weeks now and don't know where to find in man
page.
perldoc -q "How do I efficiently match many regular ex
-Original Message-
From: slow_leaner [mailto:[EMAIL PROTECTED]
Sent: Tue 10/28/2008 11:58 AM
To: beginners@perl.org
Subject: matching elements from array and print the results line by line from
log file
Hi,
I have a list of element in array that I would like to match the
pattern in lo
On Wed, 2008-09-10 at 18:14 -0700, Noah wrote:
> Hi there,
>
> could somebody please suggest some other ways to simplify the reading
> and perhaps make the following process quicker? I have a better example
> now.
>
> print CHANGE "not sure\n" unless ( grep (/not\ssure/, @lines ) );
> print CHA
On Wed, Sep 10, 2008 at 06:37:31PM -0500, Wagner, David --- Senior Programmer
Analyst --- WGO wrote:
> > From: Noah [mailto:[EMAIL PROTECTED]
> >
> > could somebody please suggest some other ways to simplify the reading
> > and perhaps make the following process quicker?
> >
> >
> > print CHA
Wagner, David --- Senior Programmer Analyst --- WGO wrote:
-Original Message-
From: Noah [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2008 16:28
To: Perl Beginners
Subject: matching lines in array - other ways to code
Hi there,
could somebody please suggest some other wa
> -Original Message-
> From: Noah [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 10, 2008 16:28
> To: Perl Beginners
> Subject: matching lines in array - other ways to code
>
> Hi there,
>
> could somebody please suggest some other ways to simplify the reading
> and perhaps make
On Tue, 2008-08-26 at 22:31 -0600, Dan Baker wrote:
> There must be some really odd stuff going on with html encoding or regx!
> Anyway, if I change my match to :: I can now catch the situation... not
> that I understand how a ' gets changed to ::
In Perl version 4, a single quote was use to de-re
From: Dan Baker <[EMAIL PROTECTED]>
> I have a thing driving me NUTS trying to detect a ' in a variable
> with regex, and either strip it out or at least detect and error out.
> for instance, this just does NOT work.
DO NOT TEST FOR DANGEROUS CHARACTERS! MAKE SURE YOU ONLY HAVE THE
SAFE ONE
Mr. Shawn H. Corey wrote:
$UploadedImage = 'badname\'s.jpg' ;
if ( $UploadedImage =~ m/'/ ) {
...
How do I match the ' ?
You match it exactly like you're doing. Since CGI is involved, I'd look
elsewhere from the problem. Are you absolutely certain that some
software between the browser a
On Tue, 2008-08-26 at 17:59 -0600, Dan Baker wrote:
> I have a thing driving me NUTS trying to detect a ' in a variable
> with regex, and either strip it out or at least detect and error out.
> for instance, this just does NOT work.
>
> $UploadedImage = 'badname\'s.jpg' ;
>
> if ( $Uploaded
From: Dan Baker [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 26, 2008 17:00
To: beginners@perl.org
Subject: matching ' in regx
I have a thing driving me NUTS trying to detect a ' in a variable
with regex, and either strip it out or at least detect and error out.
for instance, this just d
Noah wrote:
Okay,
Hello,
I need a bit of help here.
OK, I'll try.
there are thousands of lines in some files.
True.
I am trying to match the lines that have
"address\s/" and save the IP to $loopback except if
"lines" implies that the pattern can be found in more than one line?
th
Jay Savage wrote:
On Tue, Jul 8, 2008 at 10:52 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
Rob Dixon wrote:
Noah wrote:
@config_file_lines = ;
s/\s+$/\n/ foreach @config_file_lines;
The newline is only necessary if you perform the substitution only on one
set of
records. If you also a
On Sun, Jul 6, 2008 at 6:57 PM, Noah <[EMAIL PROTECTED]> wrote:
> Hi there fellow PERL coders.
>
> I am trying to match lines between a template file and a configuration file.
> If the configuration is missing a particular line that is found in the
> template file then it is printed. If the confi
On Tue, Jul 8, 2008 at 10:52 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
> Rob Dixon wrote:
>>
>> Noah wrote:
>>>
>>> Rob Dixon wrote:
Then I guess you are processing a file that originated on a Windows
system?
Windows text files have a sequence at the end of each record,
Gunnar Hjalmarsson wrote:
> Rob Dixon wrote:
>> Noah wrote:
>>> Rob Dixon wrote:
Then I guess you are processing a file that originated on a Windows system?
Windows text files have a sequence at the end of each record,
whereas
Unix files have just . is control-M, which is wh
Rob Dixon wrote:
Noah wrote:
Rob Dixon wrote:
Then I guess you are processing a file that originated on a Windows system?
Windows text files have a sequence at the end of each record, whereas
Unix files have just . is control-M, which is why vim is showing ^M at
the end of the line.
What you
Noah wrote:
> Rob Dixon wrote:
>> Noah wrote:
>>> Rob Dixon wrote:
Noah wrote:
> let me put toether some bogus output files.
You could just describe your output. Are you getting nothing at all? Or is
it
showing all lines of both files? Or none from one and all fr
Rob Dixon wrote:
Noah wrote:
in line Below
let me put toether some bogus output files.
You could just describe your output. Are you getting nothing at all? Or is it
showing all lines of both files? Or none from one and all from the other? Or
just more or fewer lines than you think is correc
Noah wrote:
Hi there fellow PERL coders.
Hello,
I am trying to match lines between a template file and a configuration
file. If the configuration is missing a particular line that is found
in the template file then it is printed. If the configuration file has
an extra line then it to gets
Noah wrote:
> in line Below
>
>>> let me put toether some bogus output files.
>>
>> You could just describe your output. Are you getting nothing at all? Or is it
>> showing all lines of both files? Or none from one and all from the other? Or
>> just more or fewer lines than you think is correct?
in line Below
let me put toether some bogus output files.
(Please bottom-post your responses to this group. Thanks.)
You could just describe your output. Are you getting nothing at all? Or is it
showing all lines of both files? Or none from one and all from the other? Or
just more or fewer l
Noah wrote:
> Rob Dixon wrote:
>> Noah wrote:
>>> Hi there fellow PERL coders.
>>>
>>> I am trying to match lines between a template file and a configuration
>>> file. If the configuration is missing a particular line that is found
>>> in the template file then it is printed. If the configurati
I wish I could share the output.
let me put toether some bogus output files.
Cheers,
Noah
Rob Dixon wrote:
Noah wrote:
Hi there fellow PERL coders.
I am trying to match lines between a template file and a configuration
file. If the configuration is missing a particular line that is found
Noah wrote:
> Hi there fellow PERL coders.
>
> I am trying to match lines between a template file and a configuration
> file. If the configuration is missing a particular line that is found
> in the template file then it is printed. If the configuration file has
> an extra line then it to get
On 11/15/07, alok nath <[EMAIL PROTECTED]> wrote:
>Is it possible to write some kind of grammars for the command and parse it
> ?
Probably. Have you seen Parse::RecDescent?
http://search.cpan.org/dist/Parse-RecDescent/
Cheers!
--Tom Phoenix
Stonehenge Perl Training
--
To unsubscribe,
On Oct 11, 9:30 am, [EMAIL PROTECTED] wrote:
> Think one of the column ($arcval) value is APBNSTWAP23. I wanted to take
> lines from
> the csv file for those columns whose value is ST for its 5th and 6th
> character. How can
> I implement this in perl using reg ex. Help needed.
Why are you maki
The is what I was looking for..Thanks All
- Original Message -
From: Jenda Krynicky <[EMAIL PROTECTED]>
Date: Thursday, October 11, 2007 7:40 pm
Subject: Re: Matching 5th and 6th characted
To: beginners@perl.org
> Date sent:Thu, 11 Oct 2007 18:30:26 +05
Date sent: Thu, 11 Oct 2007 18:30:26 +0500
From: [EMAIL PROTECTED]
Subject:Matching 5th and 6th characted
To: beginners@perl.org
Priority: normal
> Hello List,
>
> Struck up with a script in using regular expression.
[EMAIL PROTECTED] wrote:
Hello List,
Struck up with a script in using regular expression. There are 6000
lines in a csv file in which using an if conditon for a particular
column.
Think one of the column ($arcval) value is APBNSTWAP23. I wanted to
take lines from the csv file for those columns
On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
On Jun 1, 12:31 pm, [EMAIL PROTECTED] (Chas Owens) wrote:
> You might be able to get by with the code in the Perl Cookbook*.
>
> *PIRATED COPY OF COPYRIGHTED MATERIAL REMOVED
Please don't do that again. On behalf of those who enjoy the works
cre
On Jun 1, 12:04 pm, [EMAIL PROTECTED] (Ben Edwards) wrote:
> Thanks everybody for there help, did a little more dinging and came up with:-
>
> eval {
> $ftp = Net::FTP->new( $remote_host ) or die "faild to connect to
> $remote_host";
> $ftp->login( $remote_user, $remote_password ) o
On 06/01/2007 11:04 AM, Ben Edwards wrote:
[...]
The variable $flist has something like '*.cvs' in it which I guess is
almost but not quite a regular expresion.
Any idea how I can find out if $file matches the filename 'mask'
$flist. Alternatively is there a way of doing a ls and specifying a
f
On Jun 1, 12:31 pm, [EMAIL PROTECTED] (Chas Owens) wrote:
> You might be able to get by with the code in the Perl Cookbook*.
>
> *PIRATED COPY OF COPYRIGHTED MATERIAL REMOVED
Please don't do that again. On behalf of those who enjoy the works
created by people who write them for a living, I thank
On 6/1/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 6/1/07, Ben Edwards <[EMAIL PROTECTED]> wrote:
snip
> The variable $flist has something like '*.cvs' in it which I guess is
> almost but not quite a regular expresion.
snip
* in shell matching terms means .* in regex terms
. in shell matching t
I'm not sure how it works, but someone mentions using qr// instead of
qw// or "" for setting a variable/string that is going to be used in a
RegEx.
Maybe look at
http://perldoc.perl.org/perlop.html#Quote-and-Quote-like-Operators-operator%2c-quote-operator%2c-quote-like-q-qq-qx-qw-m--qr-s-tr-'-''
On 6/1/07, Ben Edwards <[EMAIL PROTECTED]> wrote:
snip
The variable $flist has something like '*.cvs' in it which I guess is
almost but not quite a regular expresion.
snip
* in shell matching terms means .* in regex terms
. in shell matching terms means \. in regex terms
cvs is the same
Where
El Jueves 17 Mayo 2007 22:11, Dr.Ruud escribió:
> xavier mas schreef:
> > I have a little problem don't have how to solve regarding matching. I
> > am working with xml files that contain labels marking the text inside
> > them.
>
> Use an XML-parser.
> http://search.cpan.org/search?m=module&q=XML+p
xavier mas schreef:
> I have a little problem don't have how to solve regarding matching. I
> am working with xml files that contain labels marking the text inside
> them.
Use an XML-parser.
http://search.cpan.org/search?m=module&q=XML+parse
--
Affijn, Ruud
"Gewoon is een tijger."
--
To un
I suppose you could use a stack object. Perl ought to have one... Check CPAN.
A stack lets you push items on and pop them off. You can read a a tag.
Its its an open tag, you push it to the stack. If its a close, you pop
the top item and check it matches.
On 5/17/07, xavier mas <[EMAIL PROTECTED]>
On 2007/03/15, at 18:29, Jenda Krynicky wrote:
From: Igor Sutton Lopes <[EMAIL PROTECTED]>
my @possible_values = qw{
http://www.google.com
https://my.domain.
http://some.other.domain.net
};
my @urls = qw{
http://www.google.com/?some_bizarre_args
https://my.domain.com
https:
> I ended up going with this:
> if ($Scratch->{url} =~ /^https?:\/\/images\.google\./) {
> Does that look OK?
Variant of your code:
if ( $scratch->{url} =~ m#^https?://images\.google\.# ) {
But you'd better go with Randal's "use URI;" advice.
You're right, I hadn't grasped what URI was
Grant schreef:
> I ended up going with this:
> if ($Scratch->{url} =~ /^https?:\/\/images\.google\./) {
> Does that look OK?
Variant of your code:
if ( $scratch->{url} =~ m#^https?://images\.google\.# ) {
But you'd better go with Randal's "use URI;" advice.
--
Affijn, Ruud
"Gewoon is
> > regex.
> > if ( m/^https?\/\/:blah\.com/)
>
>
> my @possible_values = qw{
>http://www.google.com
>https://my.domain.
>http://some.other.domain.net
> };
>
> my @urls = qw{
>http://www.google.com/?some_bizarre_args
>https://my.domain.com
>https://my.domain.net
>http:
From: Igor Sutton Lopes <[EMAIL PROTECTED]>
> On 2007/03/14, at 16:00, yitzle wrote:
>
> > regex.
> > if ( m/^https?\/\/:blah\.com/)
>
>
> my @possible_values = qw{
>http://www.google.com
>https://my.domain.
>http://some.other.domain.net
> };
>
> my @urls = qw{
>http://www.googl
1 - 100 of 359 matches
Mail list logo