Pattern match

2004-06-21 Thread Naser Ali
Hello, I have an array which was created by slurrping a whole text file. There are certain element in the array after reading the files which contain only one word. I want to only match those array elements which contain a single word and print it. Tried every thing but in vain. I must be doing s

Pattern Match

2003-12-09 Thread Eric Sand
Hi All, I am very new to Perl, but I sense a great adventure ahead after just programming with Cobol, Pascal, and C over the last umpteen years. I have written a perl script where I am trying to detect a non-printing character(Ctrl@ - Ctrl_) and then substitute a printing ASCII sequence such a

pattern match

2002-04-12 Thread Raghupathy, Ramesh .
Hi All, I have a file which has several occurances of word1 and word2 interspersed with other text. I need to extract only the text which is contained between consecutive occurances of word1 and word2 in that order. Is it possible to write a pattern match for this ? Thanks, Ramesh -- To

pattern match

2001-12-28 Thread Srinivas Reddy
Hi Here i have two pattern match statements can some one tell me whether the two are same or not. match_pattern = {",\s*",fld,"(\s+\d+)(\s+\d+)(\s+\d+)\s*,"}; changed to the following match_pattern = {",\s*",fld,"(\s+\d+){3}\s*,"}; is it same or differ

pattern match

2006-07-11 Thread Ryan Dillinger
Hello, I had two scripts that were identical, well almost. I ran the two together, but straghtened them out. Anyway I have one here, that when ran say's: Use of uninitialized value in pattern match (m//) at headline.pl line 7 and 10. I have changed differernt things within, nothing worke

pattern match

2007-02-12 Thread Vladimir Lemberg
Hi, I have a script, which suppose to find all *.xml files under the specified directory then process them. I'm facing the pattern match problem: use strict; use warnings; use Win32; use File::Find; @ARGV = Win32::GetCwd() unless @ARGV; my @dirs; find (\&FindXml, $ARGV[0]); su

pattern match problem

2003-02-13 Thread tao wang
hi, I'm trying to write a script to match a pattern like this: 1.10 I wrote [\d.]+, but this also match with pattern ... , which has no number in it. Could somebody help me with it? I'm new to perl and scripts. thanks a lot. - tao __ Do

pattern match question

2004-05-05 Thread Graeme McLaren
Hi, I'm trying to build a regular expression. to match a URL from a logfile. In the logfile an example of the pattern I'm trying to match is: 12:12:1:http://10.2.203.1/missing1.html: Retrieval command for http://10.2.203.1/missing1.html: GET /missing1.html HTTP/1.0 so far I've got: =~ /^.*?Ret

Re: Pattern match

2004-06-21 Thread Gunnar Hjalmarsson
Naser Ali wrote: I have an array which was created by slurrping a whole text file. There are certain element in the array after reading the files which contain only one word. I want to only match those array elements which contain a single word and print it. You need to anchor the word to both the

Re: Pattern match

2004-06-21 Thread Roberto Etcheverry
It's difficult to answer if you do not post the code with some input to test it, but lets suppose you have this: my @array; @array = ; # slurp whole file Then is easy to get what you want: my @lines_with_single_word = grep /^\s*\S+\s*$/,array; # ^\s*\S+\s*$ means beginning of line, 0 or more wh

Re: Pattern match

2004-06-21 Thread Chris Charley
- Original Message - From: "Naser Ali" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Monday, June 21, 2004 3:52 PM Subject: Pattern match > Hello, > > I have an array which was created by slurrping a whole text file. The

RE: Pattern match

2004-06-22 Thread Naser Ali
- From: Roberto Etcheverry [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 5:44 PM To: Naser Ali Cc: [EMAIL PROTECTED] Subject: Re: Pattern match It's difficult to answer if you do not post the code with some input to test it, but lets suppose you have this: my @array; @array = ;

Re: Pattern match

2004-06-22 Thread Gunnar Hjalmarsson
Naser Ali wrote: It works, What is it that works? The data pattern looks like this; Aword Yep, that's one word. Aword Anotherword That's two words. None of the posted suggestions matches that line. You said in your original post: "I want to only match those array elements which contain a single wo

Re: Pattern match

2004-06-22 Thread John W. Krahn
Naser Ali wrote: > > Naser Ali wrote: > > > >I have an array which was created by slurrping a whole text file. There > >are certain element in the array after reading the files which contain > >only one word. I want to only match those array elements which contain > >a single word and print it. Tr

nested pattern match

2003-07-31 Thread Raghupathy
Hi All, I have a text file as shown below. How do I match patterns like the following: Pattern to be matched: = #ifndef def .. (anything except #if) #else def ... (anything except #if) #endif def My Input Data: ==

Re: Pattern Match

2003-12-09 Thread Rob Dixon
Eric Sand wrote: > > I am very new to Perl, but I sense a great adventure ahead after just > programming with Cobol, Pascal, and C over the last umpteen years. I have > written a perl script where I am trying to detect a non-printing > character(Ctrl@ - Ctrl_) and then substitute a printing AS

RE: Pattern Match

2003-12-09 Thread Tom Kinzer
[mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 11:58 AM To: [EMAIL PROTECTED] Subject: Re: Pattern Match Eric Sand wrote: > > I am very new to Perl, but I sense a great adventure ahead after just > programming with Cobol, Pascal, and C over the last umpteen years. I have >

Re: Pattern Match

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 2:37 PM, Tom Kinzer wrote: Rob, can you explain the details of that replace? That's pretty slick. I see you're adding the hex value to get to the appropriate ASCII value, but didn't know you could do some of that gyration inside a regex. The big secret there is the /e modifi

Re: Pattern Match

2003-12-09 Thread Rob Dixon
Tom Kinzer wrote: > > Rob Dixon wrote: > > > > Eric Sand wrote: > > > > > > I am very new to Perl, but I sense a great adventure ahead after just > > > programming with Cobol, Pascal, and C over the last umpteen years. I have > > > written a perl script where I am trying to detect a non-printin

Re: Pattern Match

2003-12-09 Thread Robert Brown
xample to show what you can do in a perl regex, it might not be a very good way to do what is ultimately accomplished. First, a regular expression pattern match is conducted to find all chars in the string that are in the desired "special processing" range. Note that these are ea

Re: Pattern Match

2003-12-09 Thread Rob Dixon
but also semantically. > While it might make a good teaching example to show what you can do in > a perl regex, it might not be a very good way to do what is ultimately > accomplished. > > First, a regular expression pattern match is conducted to find all > chars in the string

Re: Pattern Match

2003-12-09 Thread Robert Brown
Rob Dixon writes: > Robert Brown wrote: > > > > Rob Dixon writes: > > > > > Tom Kinzer wrote: > > > > > I didn't think it was slick at all. In fact I was disappointed that > > > it looked such a mess, but I don't see a better way. > > > > Yes, it is indeed a mess, not only syntacticly,

Re: Pattern Match

2003-12-09 Thread Rob Dixon
Robert Brown wrote: > > Rob Dixon writes: > > Robert Brown wrote: > > > > > > Rob Dixon writes: > > > > > > > Tom Kinzer wrote: > > > > > > > I didn't think it was slick at all. In fact I was disappointed that > > > > it looked such a mess, but I don't see a better way. > > > > > > Yes

Re: Pattern Match

2003-12-09 Thread John W. Krahn
Eric Sand wrote: > > Hi All, Hello, > I am very new to Perl, Welcome. :-) > but I sense a great adventure ahead after just > programming with Cobol, Pascal, and C over the last umpteen years. "Thinking in Perl" may take a while but it is not your grandfather's programming language (sorry

Re: Pattern Match

2003-12-09 Thread John W. Krahn
Rob Dixon wrote: > > I didn't think it was slick at all. In fact I was disappointed that it looked > such a mess, but I don't see a better way. Anyway, the statement is > > s/([\x00-\1F])/'^'.chr(ord($1) + 0x40)/eg > > where the regex is > > ([\x00-\1F]) Oops. That matches the characters

Re: Pattern Match

2003-12-09 Thread Robert Brown
Rob Dixon writes: > I'm sure you have something useful to say. This seems such a waste of > your effort. > > Rob I think we are failing to communicate. What I am asking is: "Does the regular expression mechanism in perl optimize regular expressions such as the one you used earlier in this t

Re: Pattern Match

2003-12-09 Thread Casey West
It was Tuesday, December 09, 2003 when Robert Brown took the soap box, saying: : Rob Dixon writes: : > I'm sure you have something useful to say. This seems such a waste of : > your effort. : > : > Rob : : I think we are failing to communicate. What I am asking is: Thanks for the clarificat

Re: Pattern Match

2003-12-09 Thread Robert Brown
Casey West writes: > : "Does the regular expression mechanism in perl optimize regular > : expressions such as the one you used earlier in this thread so that > : the execution overhead is nearly as good as the C approach I outlined > : earlier in this thread? In other words, for the problem s

Re: Pattern Match

2003-12-10 Thread mcdavis941
Since we're now talking about performance issues, somebody should say something about precompiling the regular expression, when you can, with either /o or qr(). I had a process's running time go from 2min 45sec to just under 24sec simply by using qr on the relevant regular expressions. Robert

Re: Pattern Match

2003-12-10 Thread Rob Dixon
ed. The stark realisation is that an infinite majority of problems have no solution at all. This is a Perl newsgroup. > First, a regular expression pattern match is conducted to find > all chars in the string that are in the desired "special > processing" range. Note that these

Re: Pattern Match

2003-12-10 Thread Jenda Krynicky
From: Robert Brown <[EMAIL PROTECTED]> > Casey West writes: > > : "Does the regular expression mechanism in perl optimize regular > > : expressions such as the one you used earlier in this thread so that > > : the execution overhead is nearly as good as the C approach I > outlined > : earlier i

Re: Pattern Match

2003-12-10 Thread Robert Brown
On Wed, 10 Dec 2003 20:11:26 +0100, "Jenda Krynicky" <[EMAIL PROTECTED]> wrote: > > 1. Perl builtins and especialy the regular expression engine is > heavily optimized. So it might very well be quicker to use a regexp > from Perl than to implement the same stuff in C. Unless you spend a >

Re: Pattern Match

2003-12-10 Thread R. Joseph Newton
Robert Brown wrote: > Casey West writes: > Sorry again for my confusing way of expressing myself. Although I > wrote my example in C, that was because I am a novice perl programmer, > but an experienced C programmer, so I expressed my algorithm in C. > > The idea was to compare the execution effe

Re: Pattern Match

2003-12-10 Thread Robert Brown
R. Joseph Newton writes: > When used consciously, with at least a general awareness of the processing > load being invoked, regexes can do some really incredible things. Thanks! I especially appreciate the example you gave showing how to trim both ends of a string: that it is more efficient to

Re: Pattern Match

2003-12-12 Thread Rob Dixon
Robert Brown wrote: > > R. Joseph Newton writes: > > When used consciously, with at least a general awareness of the processing > > load being invoked, regexes can do some really incredible things. > > Thanks! I especially appreciate the example you gave showing how to > trim both ends of a stri

RE: pattern match

2002-04-12 Thread Timothy Johnson
ot;\n"; } } Someone else might have a better one, though. -Original Message- From: Raghupathy, Ramesh . [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 11:29 AM To: [EMAIL PROTECTED] Subject: pattern match Hi All, I have a file which has several occurances of word1 and w

Re: pattern match

2002-04-12 Thread drieux
On Friday, April 12, 2002, at 12:38 , Raghupathy, Ramesh . wrote: > I am sorry I was not clear in my question. > >The word1 and word2 may occur on different lines of the file and may > occur in different combinations. > > for e.g : > > (not showing the new lines..) > > > word1.word1.

RE: pattern match

2002-04-12 Thread David Gray
> for e.g : > > (not showing the new lines..) > > > word1.word1.word1word2word1...word2wor > d2word2 > . You're gonna want to check out (in the perldoc perlre manpage) (??{ code }), which is an example of a recursive regular expression. They have an exampl

Re: pattern match

2002-04-12 Thread bob ackerman
On Friday, April 12, 2002, at 12:58 PM, David Gray wrote: >> for e.g : >> >> (not showing the new lines..) >> >> >> word1.word1.word1word2word1...word2wor >> d2word2 >> . > > You're gonna want to check out (in the perldoc perlre manpage) (??{ code > }), which

Re: pattern match

2002-04-15 Thread bob ackerman
> On Monday, April 15, 2002, at 10:32 AM, Raghupathy, Ramesh . wrote: > >> Bob, >> >>You are right about what I wanted to achieve. I was wondering, if I >> could >> do it using just pattern match, without using any control structures like >>

Pattern match woos

2001-12-05 Thread Dermot Paikkos
Hi there, This is both frustrating and embarrassing. I can't capture the following data into a variable. The line I want is: GIAZUC00 I have tried a multitude of Regex, none seems to be working. Here's my last attempt: open(F,"$i"); while (defined( $p = )) { chomp($p); ($co

RE: pattern match

2001-12-28 Thread Hanson, Robert
28, 2001 11:38 AM To: Hanson, Robert; '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: pattern match Hi Here i have two pattern match statements can some one tell me whether the two are same or not. match_pattern = {",\s*",fld,"(\s+\d+)(\s+\d+)(\s+\d+)\s*,&quo

Pattern match question

2009-05-27 Thread 流水音
Hi, All: I want to parse data from a HTML page, data like: YEMEN YE

RE: pattern match

2006-07-11 Thread Timothy Johnson
-Original Message- From: Ryan Dillinger [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 6:28 PM To: beginners@perl.org Subject: pattern match Use of uninitialized value in pattern match (m//) at headline.pl line 7 and 10. #!/usr/bin/perl use warnings; use strict; open

Re: pattern match

2006-07-11 Thread Mr. Shawn H. Corey
Ryan Dillinger wrote: > Hello, > I had two scripts that were identical, well almost. I ran the two > together, but > straghtened them out. Anyway I have one here, that when ran say's: Use > of uninitialized > value in pattern match (m//) at headline.pl line 7 and 10. I ha

Re: pattern match

2006-07-11 Thread Mr. Shawn H. Corey
Ryan Dillinger wrote: > Hello, > I had two scripts that were identical, well almost. I ran the two > together, but > straghtened them out. Anyway I have one here, that when ran say's: Use > of uninitialized > value in pattern match (m//) at headline.pl line 7 and 10. I ha

Re: pattern match

2006-07-11 Thread Mumia W.
Ryan Dillinger wrote: > [...] > #!/usr/bin/perl > use warnings; > use strict; > > open LYNX, "lynx -source http://www.perl.com/ |" or die "Can't open lynx: > $!"; > $_ = ""; > $_ = until /standard\.def/; > If 'standard.def' is not found, this line loops forever. > my $head = ; > $head =~ m|^]

Re: pattern match

2006-07-12 Thread Rob Dixon
Ryan Dillinger wrote: > > Hello, Hi Ryan > I had two scripts that were identical, well almost. I ran the two together, > but straghtened them out. Anyway I have one here, that when ran say's: Use of > uninitialized value in pattern match (m//) at headline.pl line 7 and 1

RE: pattern match

2006-07-13 Thread Ken Foskey
On Tue, 2006-07-11 at 18:48 -0700, Timothy Johnson wrote: > open(LYNX,"<","lynx -source http://www.perl.com/ |") or die("Can't open > lynx: $!"); I am not sure that this is right. open(LYNX,"|-","lynx -source http://www.perl.com/";) or die("Can't open lynx: $!"); I think this is. Ta Ken --

Re: pattern match

2006-07-13 Thread Dr.Ruud
Ken Foskey schreef: > open(LYNX,"|-","lynx -source http://www.perl.com/";) or die("Can't open > lynx: $!"); #!/usr/bin/perl use warnings ; use strict ; my $cmd = 'lynx -source http://www.perl.com/' ; open my $ph, '-|', $cmd or die "\nError opening '$cmd', stopped $!" ; while ( <

RE: pattern match

2007-02-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Vladimir Lemberg [mailto:[EMAIL PROTECTED] > Sent: Monday, February 12, 2007 12:33 > To: beginners@perl.org > Subject: pattern match > > Hi, > > I have a script, which suppose to find all *.xml files under > the specified dire

Re: pattern match

2007-02-12 Thread Vladimir Lemberg
David, Thanks you very much! It works -) - Original Message - From: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> To: "Vladimir Lemberg" <[EMAIL PROTECTED]>; Sent: Monday, February 12, 2007 12:46 PM Subject: RE: pattern

Re: pattern match

2007-02-12 Thread D. Bolliger
Vladimir Lemberg am Montag, 12. Februar 2007 21:33: > Hi, Hi Vladimir (in addition to Davids post) > I have a script, which suppose to find all *.xml files under the specified > directory then process them. I'm facing the pattern match problem: > > use strict; > use warni

Re: pattern match

2007-02-12 Thread John W. Krahn
Vladimir Lemberg wrote: > Hi, Hello, > I have a script, which suppose to find all *.xml files under the specified > directory then process them. I'm facing the pattern match problem: > > use strict; > use warnings; > use Win32; > use File::Find; > > @ARGV =

Re: pattern match

2007-02-12 Thread Mumia W.
On 02/12/2007 02:33 PM, Vladimir Lemberg wrote: Hi, I have a script, which suppose to find all *.xml files under the specified directory then process them. I'm facing the pattern match problem: use strict; use warnings; use Win32; use File::Find; @ARGV = Win32::GetCwd() unless @ARGV;

Re: pattern match

2007-02-12 Thread D. Bolliger
Mumia W. am Montag, 12. Februar 2007 21:53: > On 02/12/2007 02:33 PM, Vladimir Lemberg wrote: > > Hi, > > > > I have a script, which suppose to find all *.xml files under the > > specified directory then process them. I'm facing the pattern match > > problem

Pattern match operator

2013-05-04 Thread Florian Huber
Hi all, I'm parsing a logfile and don't quite understand the behaviour of m//. From a previous regex match I have already captured $+{'GFP'}: use strict; use warnings; (...) $text =~ m/ (?FILTERS .*? WRT)/x;# I simply have my whole logfile in $text - I know there are better solutions.

RE: pattern match problem

2003-02-13 Thread Wagner, David --- Senior Programmer Analyst --- WGO
tao wang wrote: > hi, > > I'm trying to write a script to match a pattern like > this: 1.10 > > I wrote [\d.]+, but this also match with pattern ... > , which has no number in it. Could somebody help me > with it? I'm new to perl and scripts. thanks a lot. /^\d+\.\d+/ which says ancho

RE: pattern match problem

2003-02-13 Thread Timothy Johnson
: [EMAIL PROTECTED] Subject: pattern match problem hi, I'm trying to write a script to match a pattern like this: 1.10 I wrote [\d.]+, but this also match with pattern ... , which has no number in it. Could somebody help me with it? I'm new to perl and scripts. thanks a l

Re: pattern match problem

2003-02-13 Thread Wiggins d'Anconia
tao wang wrote: hi, I'm trying to write a script to match a pattern like this: 1.10 I wrote [\d.]+, but this also match with pattern ... , which has no number in it. Could somebody help me with it? I'm new to perl and scripts. thanks a lot. \d.\d+ \d+.\d+ \d*.\d* \d+\.+\d+ \d+\.*\d+ \

Re: pattern match problem

2003-02-13 Thread ktb
On Thu, Feb 13, 2003 at 04:39:17PM -0800, tao wang wrote: > hi, > > I'm trying to write a script to match a pattern like > this: 1.10 > > I wrote [\d.]+, but this also match with pattern ... > , which has no number in it. Could somebody help me > with it? I'm new to perl and scripts. thank

Re: pattern match question

2004-05-05 Thread Jose Alves de Castro
I would do /(?<=Retrieval command for )http:.*?:/ The "Retrieval" part now is contained in a "Look behind section", which is to mean it's not going to be stored as part of the match. I'm not sure what other cases you can get in that log file, but this solves the problem for that particular line

Re: pattern match question

2004-05-05 Thread Graeme McLaren
ROTECTED]> To: Graeme McLaren <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: pattern match question Date: 05 May 2004 11:09:19 +0100 MIME-Version: 1.0 Received: from onion.perl.org ([63.251.223.166]) by mc5-f36.hotmail.com with Microsoft SMTPSVC(5.0.2195.6824); Wed, 5 May 2004 03:13:0

Re: pattern match question

2004-05-05 Thread Jose Alves de Castro
/(?<=Retrieval command for )http:.*?:/){ > > It prints off the "Retrieval command for" part as it did before :( > > > any ideas? > > > Cheers, > > Graeme :) > > > > >From: Jose Alves de Castro <[EMAIL PROTECTED]> > >To: Gr

Re: nested pattern match

2003-07-31 Thread Rob Dixon
Raghupathy wrote: > Hi All, > > I have a text file as shown below. How do I match > patterns like the following: > > Pattern to be matched: > = > #ifndef def > .. (anything except #if) > #else def > ... (anything except #if) > #endif def > > > My Input Data: > =

Re: nested pattern match

2003-07-31 Thread Raghupathy
Rob, The input file you described is not correct, since it has #ifdef def2 statement3; #else statement4; #endif nested within another #ifdef ... #else ... #endif. My input file is the output of "diff -D def file1 file2" (on unix). This will generate a file which has the following pattern

Re: nested pattern match

2003-07-31 Thread david
Raghupathy wrote: > Rob, > >The input file you described is not correct, since > it has > #ifdef def2 > statement3; > #else > statement4; > #endif > nested within another #ifdef ... #else ... #endif. > > My input file is the output of > "diff -D def file1 file2" (on unix). This will > gen

Re: nested pattern match

2003-08-01 Thread Raghupathy
Rob and David, Thanks very much! That's exactly what I am looking for and sorry for the misleading subject on the email. Rob: Could you please explain why you need 2 questions marks on line#7 instead of just one minimal quantifier needed (I hope I am using the right words this time !!!). Tha

Re: nested pattern match

2003-08-01 Thread Rob Dixon
"Raghupathy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Rob and David, > > Thanks very much! That's exactly what I am looking > for and sorry for the misleading subject on the email. > > > Rob: Could you please explain why you need 2 questions > marks on line#7 instead of just

please help !! pattern match

2003-09-05 Thread Pandey Rajeev-A19514
Hi , I need some help me to extract a pattern. The delimiters is a pair of "abcd" and "efgh". Can some one help me with an efficient use of Greedy and non greedy matches, look ahead and lookbehind features. I want the smallest match involving the two delimiters. I want all the matches. i.e. f

[ADMIN] Re: Pattern Match

2003-12-10 Thread Casey West
It was Wednesday, December 10, 2003 when Rob Dixon took the soap box, saying: : Before I finally burst my cyanide capsule, may I.. ? No, you may not. I find walking around the block a good way to cool off. Counting to ten has never done it for me, but you may try. *Both* of you. Thanks for killi

RE: Pattern match woos

2001-12-05 Thread Sonia Patel
Dermot Paikkos [mailto:[EMAIL PROTECTED]] Sent: 05 December 2001 12:32 To: [EMAIL PROTECTED] Subject: Pattern match woos Hi there, This is both frustrating and embarrassing. I can't capture the following data into a variable. The line I want is: GIAZUC00 I have tried a multitude of Regex, none

Re: Pattern match woos

2001-12-05 Thread Maxim Berlin
Hello Dermot, Wednesday, December 05, 2001, Dermot Paikkos <[EMAIL PROTECTED]> wrote: DP> Hi there, DP> This is both frustrating and embarrassing. I can't capture the DP> following data into a variable. The line I want is: DP> GIAZUC00 DP> I have tried a multitude of Regex, none seems to be w

Re: Pattern match woos

2001-12-05 Thread Leon
- Original Message - From: "Dermot Paikkos" <[EMAIL PROTECTED]> > Hi there, > This is both frustrating and embarrassing. I can't capture the > following data into a variable. The line I want is: > GIAZUC00 > > I have tried a multitude of Regex, none seems to be working. Here's > my last at

Re: Pattern match question

2009-05-27 Thread Alexander Koenig
You wrote on 05/27/2009 10:50 AM: > I want to match one ... pair. > > my code : > > my $pattern = "()"; ... > but I got the whole matches instead of one ... pair each loop. Do need to de-greedify it. my $pattern = "()"; This should do the trick. hth Alex -- To unsubscribe, e-mail: beginner

Re: Pattern match question

2009-05-27 Thread Jenda Krynicky
Date sent: Wed, 27 May 2009 16:50:41 +0800 Subject:Pattern match question From: Á÷Ë(R)`Oô To: beginners@perl.org > Hi, All: > > I want to parse data from a HTML page,

[Correction] Re: pattern match

2007-02-12 Thread D. Bolliger
D. Bolliger am Montag, 12. Februar 2007 23:03: > Mumia W. am Montag, 12. Februar 2007 21:53: > > On 02/12/2007 02:33 PM, Vladimir Lemberg wrote: [snipped] Mumia, please excuse me for my inappropriate correction! > > You probably want to push the filename onto the array if you get a > > successfu

Re: Pattern match operator

2013-05-04 Thread Rob Dixon
{'GFP'} is $+{'GFP'}.\n"; print "\$+{'AVG'} is $+{'AVG'}.\n"; prints this: $+{'GFP'} is FILTERS GFP,GFP,100% ACTSHUT 17 AVG 4,1.00 WRT. $+{'AVG'} is . So now the match suddenly fails?!? Hello Florian First a couple of

Re: Pattern match operator

2013-05-04 Thread Florian Huber
built-in variables that relate to regular expressions are modified by every successful pattern match. It is safer to save values that you may want to use later in a sperate variable. In particular, your regex m/(?AVG\s\d)/ matches and, because there is no capture named `GFP` it sets the correspondi

Re: Pattern match operator

2013-05-04 Thread Jim Gibson
\d)?(PATTERN3)/; > and one of the patterns is not there, still everything will be shifted to the > right, won't it? I figured that by naming the captures, I will always know if > there was a match at the very position intended. If the regular expression does not match all three p

Re: please help !! pattern match

2003-09-05 Thread Rob Anderson
"Pandey Rajeev-A19514" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi , Hello > > I need some help me to extract a pattern. The delimiters is a pair of "abcd" and "efgh". Can some one help me with an efficient use of Greedy and non greedy matches, look ahead and lookbehind feat

Re: [ADMIN] Re: Pattern Match

2003-12-10 Thread Rob Dixon
Casey West wrote: > > : Before I finally burst my cyanide capsule, may I.. ? > > No, you may not. > > I find walking around the block a good way to cool off. Counting to ten > has never done it for me, but you may try. *Both* of you. > > Thanks for killing the personal tension between you two, on t

Re: [ADMIN] Re: Pattern Match

2003-12-10 Thread Casey West
It was Wednesday, December 10, 2003 when Rob Dixon took the soap box, saying: : Casey West wrote: : > : > : Before I finally burst my cyanide capsule, may I.. ? : > : > No, you may not. : > : > I find walking around the block a good way to cool off. Counting to ten : > has never done it for me, but

One pattern match? or multiple?

2002-03-18 Thread Nikola Janceski
I know this must be a stupid question but: let's suppose I am matching for one of multiple matches. Is it better/faster to split it into several pattern matches or just keep it one match? ie: which would be better/faster? /:\s*$|^\n$|\*|etc/; /:\s*$/ || /^\n$/ || /\*/ || /etc/ and just for k

what does this pattern match?

2002-06-23 Thread Postman Pat
$_=~s/\n//msg; What does the above match? LK -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Split and pattern match problem

2001-09-11 Thread Bradshaw, Brian
x27;t figure out how to find the beginning and the end of the tag. I have been trying to pattern match for the right combo for an hour and I am just not getting it. Thanks for any help. Sample string: If you compare plant and animal cells, you will discover differences. Plant cells are stiff and

Regex pattern match in perl

2008-12-14 Thread explor
Hi Gurus, I am new to perl and need some help to learn regex in perl. From the below line i need to extract following: Part I 1) $ENVFROM = dapi...@testhost.com 2) $ENVTO1 = te...@etc.com 3) $ENVTO2 = te...@etc.com 4) $ENVTO3 = samt...@abc.com line=EnvFrom: dapi...@testhost.com, HdrTo: , EnvTo:

Uninitialized value in pattern match

2008-03-31 Thread Johan
The last line of this code foreach $PkgFile( @$PkgList ) { if( $PkgFile =~m/^\s*$/) gives this warning message Use of uninitialized value in pattern match (m//) at packagefile.pm line 838. How can I solve this? (I have no idea what the code does...) -- To unsubscribe, e-mail: [EMAIL

Re: [Correction] Re: pattern match

2007-02-12 Thread Mumia W.
On 02/12/2007 04:17 PM, D. Bolliger wrote: D. Bolliger am Montag, 12. Februar 2007 23:03: Mumia W. am Montag, 12. Februar 2007 21:53: On 02/12/2007 02:33 PM, Vladimir Lemberg wrote: [snipped] Mumia, please excuse me for my inappropriate correction! [...] No problem. I'm glad I tested it be

including . in a pattern match

2006-01-27 Thread Keith Worthington
Hi All, I am still a newbie in Perl and it is only with the help of this list that I was able to construct the following pattern match. ($v_size_str =~ /\d+\s*['"]\s*x\s*\d+\s*['"]/i) The problem that I have just realized that this string will match the first line of thi

Re: One pattern match? or multiple?

2002-03-18 Thread Jonathan E. Paton
> I know this must be a stupid question but: It is not! :) > Let's suppose I am matching for one of > multiple matches. Is it better/faster to > split it into several pattern matches or > just keep it one match? > > ie: which would be better/faster? If matches can usually be found near the be

Re: what does this pattern match?

2002-06-23 Thread Shawn
Hello again, This will remove all new lines from $_. Shawn - Original Message - From: "Postman Pat" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 24, 2002 1:49 AM Subject: what does this pattern match? > $_=~s/\n//msg; > > Wha

Re: what does this pattern match?

2002-06-24 Thread John W. Krahn
Postman Pat wrote: > > $_=~s/\n//msg; > > What does the above match? That matches the newline character (\n) globally (/g) and replaces it with nothing. The /m option is not needed because the ^ and $ anchors are not used and the /s option is not needed because there is no . in the regular exp

Re: Split and pattern match problem

2001-09-11 Thread Jason Tiller
Hi, Brian, :) I'm by no means a Perl expert, but I was intrigued that you asked a question I *might* actually be able to answer, so here goes: On Tue, 11 Sep 2001, Bradshaw, Brian wrote: > I have a string that I want to substitute words for each > tag. I am pretty sure I want to split the stri

Re: Split and pattern match problem

2001-09-11 Thread Andrea Holstein
Jason Tiller wrote: > ... > #!/usr/bin/perl > > # Store the text you provided in your e-mail as a big string. > $text = < > # Remove new lines, splitting into an array. > @text = split( "\n", $text ); > > # Now weld the string back together, with spaces instead of newlines! > $text = join(

Re: Split and pattern match problem

2001-09-11 Thread Jason Tiller
Hi, Andrea, :) On Wed, 12 Sep 2001, Andrea Holstein wrote: > Jason Tiller wrote: > > # Find the string bounded by "". The '.+?' > > # finds all characters but isn't greedy; ".+" would match all of the > > # characters between the first "". > > # Store this match as $1. > > while( $text =~ /()/

RE: Split and pattern match problem

2001-09-12 Thread Bradshaw, Brian
Thanks for the info I got. I wound up with: @stringT = split(//i, $qText); to do what I needed. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Net::Telnet "pattern match timed-out..."

2008-09-17 Thread ariel . casas
Hello all, I am trying to automate a simple telnet to port 7010 and give me the output to the command "gstatus". However, I get the following error: ./telnet_mod.test.pl pattern match timed-out at ./telnet_mod.test.pl line 6 Here are the contents of

Re: Regex pattern match in perl

2008-12-14 Thread Chas. Owens
On Sat, Dec 13, 2008 at 19:35, explor wrote: > Hi Gurus, > I am new to perl and need some help to learn regex in perl. From the > below line i need to extract following: > > Part I > 1) $ENVFROM = dapi...@testhost.com > 2) $ENVTO1 = te...@etc.com > 3) $ENVTO2 = te...@etc.com > 4) $ENVTO3 = samt...

Re: Regex pattern match in perl

2008-12-14 Thread John W. Krahn
explor wrote: Hi Gurus, Hello, I am new to perl and need some help to learn regex in perl. From the below line i need to extract following: Part I 1) $ENVFROM = dapi...@testhost.com 2) $ENVTO1 = te...@etc.com 3) $ENVTO2 = te...@etc.com 4) $ENVTO3 = samt...@abc.com line=EnvFrom: dapi...@tes

  1   2   >