Re: Pattern match operator

2013-05-04 Thread Rob Dixon
On 04/05/2013 14:26, Florian Huber wrote: 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/ (?GFPFILTERS .*? WRT)/x;# I simply have my whole logfile in $text

Re: Pattern match operator

2013-05-04 Thread Florian Huber
On 05/04/2013 04:37 PM, Rob Dixon wrote: On 04/05/2013 14:26, Florian Huber wrote: 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/ (?GFPFILTERS .*? WRT)/x;

Re: Pattern match operator

2013-05-04 Thread Jim Gibson
On May 4, 2013, at 11:53 AM, Florian Huber wrote: On 05/04/2013 04:37 PM, Rob Dixon wrote: On 04/05/2013 14:26, Florian Huber wrote: Hello Florian First a couple of points - Don't use named captures for simple regexes like this. They make the code harder to understand, and

Re: Pattern matching to hash

2012-12-29 Thread Dr.Ruud
On 2012-12-28 21:32, twle...@reagan.com wrote: I hope this is a simple fix. I want to check the beginning characters of items in a hash, and compare that to a scalar variable. I do not need for the entire value to match; just the first couple of characters. Here is a simple example of what

Re: Pattern matching to hash

2012-12-28 Thread timothy adigun
Hi, my $prefix_search_list = '03S,04S'; my @prefix_array = split /\,/,$prefix_search_list; my %prefix_hash = map {$_ = 1 } @prefix_array; #compare 05S to 03S and 04S my $input_field = 05S885858; #should not match 1. using stricts and warnings pragma, shows clearly that there is nothing

Re: Pattern matching to hash

2012-12-28 Thread Chris Charley
Tim wrote in message news:1356726727.215915...@webmail.reagan.com... I hope this is a simple fix. I want to check the beginning characters of items in a hash, and compare that to a scalar variable. I do not need for the entire value to match; just the first couple of characters. Tim my

Re: Pattern matching to hash

2012-12-28 Thread timothy adigun
Hello Chris, Please see my comment below. On Fri, Dec 28, 2012 at 10:24 PM, Chris Charley char...@pulsenet.comwrote: Tim wrote in message news:1356726727.215915216@**webmail.reagan.com... I hope this is a simple fix. I want to check the beginning characters of items in a hash, and

Re: Pattern matching to hash

2012-12-28 Thread Chris Charley
Chris Charley wrote in message news Tim wrote in message news:1356726727.215915...@webmail.reagan.com... I hope this is a simple fix. I want to check the beginning characters of items in a hash, and compare that to a scalar variable. I do not need for the entire value to match; just the

RE: Pattern matching to hash

2012-12-28 Thread Tim Lewis
@perl.org Subject: Re: Pattern matching to hash Hi, my $prefix_search_list = '03S,04S'; my @prefix_array = split /\,/,$prefix_search_list; my %prefix_hash = map {$_ = 1 } @prefix_array; #compare 05S to 03S and 04S my $input_field = 05S885858; #should not match 1. using stricts

RE: Pattern matching to hash

2012-12-28 Thread Tim Lewis
Thank you Chris. Using strict and warnings should have been the first thing that I did. Thank you also for the code correction. -Original Message- From: Chris Charley [mailto:char...@pulsenet.com] Sent: Friday, December 28, 2012 5:52 PM To: beginners@perl.org Subject: Re: Pattern

Re: Pattern matching to hash

2012-12-28 Thread Chris Charley
timothy adigun wrote in message news:CAEWzkh6mZohVJn__LRL60AGoqbHkmTPyn=JM=cewcmmftpj...@mail.gmail.com... Hello Chris, Please see my comment below. On Fri, Dec 28, 2012 at 10:24 PM, Chris Charley char...@pulsenet.comwrote: [snip] I only answered the question using a for loop. Am

Re: pattern matching regex

2011-09-27 Thread Shawn H Corey
On 11-09-27 05:30 PM, Chris Stinemetz wrote: Trying to match the what is contained in $what 3 consecutive times. But I am getting the followoing error: Use of uninitialized value $_ in pattern match (m//) at ./ex9-1.pl line 7. The program: #!/usr/bin/perl use warnings; use strict; my $what

Re: Pattern matching problem - Why won't this work?

2010-04-13 Thread Peter Scott
On Mon, 12 Apr 2010 23:04:53 -0500, Owen Chavez wrote: Can you suggest a reference on hashes that will provide some clue as to how they can be used for the problem I posted? I've looked over Programming Perl (3rd) and it's not entirely clear to me how to proceed with a hash. Learning Perl

Re: Pattern matching problem - Why won't this work?

2010-04-13 Thread Shawn H Corey
Owen Chavez wrote: Hello! I have a pattern matching question using Perl 5.10, Windows 7. Suppose I have a file containing the following block of text: Hello there TODD I my We Us ourselves OUr I. The file has 10 words, including 7 first-person pronouns (and 3 non-pronouns that I have no

Re: Pattern matching problem - Why won't this work?

2010-04-12 Thread Peter Scott
On Mon, 12 Apr 2010 21:06:58 -0500, Owen Chavez wrote: I have a pattern matching question using Perl 5.10, Windows 7. Suppose I have a file containing the following block of text: Hello there TODD I my We Us ourselves OUr I. The file has 10 words, including 7 first-person pronouns (and 3

Re: Pattern matching problem - Why won't this work?

2010-04-12 Thread Owen Chavez
Thank you for the feedback. I do apologize for not posting a working example; I can't post the full code and I was attempting to extract the offending sections. I have no particular fondness for grep. A search of postings on perlmonks revealed a variation of the code I employed. I am learning

Re: Pattern match question

2009-05-27 Thread Alexander Koenig
You wrote on 05/27/2009 10:50 AM: I want to match one tr.../tr pair. my code : my $pattern = (tr (.|\\n)*\\\/tr); ... but I got the whole matches instead of one tr.../tr pair each loop. Do need to de-greedify it. my $pattern = (tr (.|\\n)*?\\\/tr); This should do the trick. hth Alex

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ô aoi...@gmail.com To: beginners@perl.org Hi, All: I want to parse data from a HTML page, data like: tr td

Re: Pattern matching question

2009-03-31 Thread Telemachus
On Tue Mar 31 2009 @ 3:32, Richard Hobson wrote: It works, but is there a way of combining these lines: my $piece = $ref-[$_]; $piece =~ /.*(..$)/; It feels like this could be done in one step. Is this correct? I'm finding that I'm doing

Re: Pattern matching question

2009-03-31 Thread John W. Krahn
Richard Hobson wrote: Hi, Hello, Please be patient with this beginner. I have a subrouting as follows, that prints out an ASCII representation of chess board sub display_board { foreach (0..7) { my $ref = @_[$_]; That should be: my $ref = $_[$_]; Or better:

RE: pattern matching question

2008-09-23 Thread sanket vaidya
Hi Anjan, Not able to get what your column is. I am Assuming your column is in Text file. However even if it is not in text file, then this may provide you a fair hint about how to proceed further. use warnings; use strict; open FH,example.txt or die Cannot open file: $!; #(example.txt

Re: pattern matching question

2008-09-23 Thread Mr. Shawn H. Corey
On Mon, 2008-09-22 at 21:21 -0400, ANJAN PURKAYASTHA wrote: here is my problem: i have to check the entries of a column and write them out to a file if they happen to be DNA sequences ie they are exclusively composed of the letters A, T, G, C- no spaces or digits. the column also happens to

RE: pattern matching question

2008-09-23 Thread sanket vaidya
Hi Anjan, Not able to get where your column is. I am Assuming your column is in Text file. However even if it is not in text file, then also this may provide you a fair hint about how to proceed further. use warnings; use strict; open FH,example.txt or die Cannot open file: $!;

Re: pattern matching question

2008-09-23 Thread ANJAN PURKAYASTHA
hi all, the column is in a text file. fyi, david's pattern matching expression (/^[ATGC]+$/i) did the job perfectly. thanks all for you feedback! anjan On Tue, Sep 23, 2008 at 5:07 AM, sanket vaidya [EMAIL PROTECTED]wrote: Hi Anjan, Not able to get where your column is. I am Assuming

Re: Pattern matching question

2008-09-23 Thread Mr. Shawn H. Corey
On Tue, 2008-09-23 at 14:05 -0700, Darren Nay wrote: Here is the string: xsl:output method=html encoding=utf-8 indent=yes doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; doctype-public=-//W3C//DTD XHTML 1.0 Transitional//EN / Now, I want to match against that string

RE: pattern matching question

2008-09-22 Thread Dave
-Original Message- From: ANJAN PURKAYASTHA [mailto:[EMAIL PROTECTED] Sent: Tuesday, 23 September 2008 11:22 AM To: beginners@perl.org Subject: pattern matching question here is my problem: i have to check the entries of a column and write them out to a file if they happen to be DNA

Re: pattern -help

2008-06-22 Thread yitzle
On 6/22/08, Pad [EMAIL PROTECTED] wrote: Need your help again! I have a file that contains several _begin and _end classes with _begin is that start of the block and _end being the end of block. Sometimes we miss either _begin or _end. I am trying to write a script that find every

Re: pattern -help

2008-06-22 Thread Rob Dixon
Pad wrote: I have a file that contains several _begin and _end classes with _begin is that start of the block and _end being the end of block. Sometimes we miss either _begin or _end. I am trying to write a script that find every _begin should contain _end. If for reasons _end is

Re: pattern -help

2008-06-22 Thread Rob Dixon
Rob Dixon wrote: Pad wrote: I have a file that contains several _begin and _end classes with _begin is that start of the block and _end being the end of block. Sometimes we miss either _begin or _end. I am trying to write a script that find every _begin should contain _end. If for reasons

Re: pattern -help

2008-06-22 Thread Rob Dixon
yitzle wrote: On 6/22/08, Pad [EMAIL PROTECTED] wrote: Need your help again! I have a file that contains several _begin and _end classes with _begin is that start of the block and _end being the end of block. Sometimes we miss either _begin or _end. I am trying to write a script that

Re: pattern -help

2008-06-22 Thread Pad
More detail about the format would help. Assuming the expected format is something like: _begin CLASS_A ... _end CLASS_A ... _begin CLASS_B ... _end CLASS_B == CODE == Thanks Yitzle and Rob for you quick response. I apprecitiate your help and writing style tips. I just want to

Re: pattern -help

2008-06-22 Thread John W. Krahn
Pad wrote: More detail about the format would help. Assuming the expected format is something like: _begin CLASS_A ... _end CLASS_A ... _begin CLASS_B ... _end CLASS_B Thanks Yitzle and Rob for you quick response. I apprecitiate your help and writing style tips. I just want to give more

Re: Pattern matching problem

2008-02-29 Thread Gunnar Hjalmarsson
Anirban Adhikary wrote: Subject: Pattern matching problem As far as I can tell, this is not a pattern matching problem. I have a very large file basically it is logfile generated by sql loader. In the production environment this file can have one million/ two million data. In this

Re: Pattern matching

2007-02-21 Thread Dr.Ruud
Dharshana Eswaran schreef: TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID TAPI_TTY_NOTIFY_TTY_TONE_MSGID [...] Can anyone help me in getting a generalised pattern from these? m/^ TAPI (?:_[A-Z]+)+ $/x -- Affijn, Ruud Gewoon is een tijger. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Pattern matching

2007-02-21 Thread Dharshana Eswaran
On 2/21/07, Dr.Ruud [EMAIL PROTECTED] wrote: Dharshana Eswaran schreef: TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID TAPI_TTY_NOTIFY_TTY_TONE_MSGID [...] Can anyone help me in getting a generalised pattern from these? m/^ TAPI (?:_[A-Z]+)+ $/x -- Affijn, Ruud Gewoon is een tijger. -- To

Re: Pattern matching

2007-02-21 Thread Dharshana Eswaran
On 2/21/07, Dharshana Eswaran [EMAIL PROTECTED] wrote: On 2/21/07, Dr.Ruud [EMAIL PROTECTED] wrote: Dharshana Eswaran schreef: TAPI_VOICE_NOTIFY_OTHERAPP_JOINING_MSGID TAPI_TTY_NOTIFY_TTY_TONE_MSGID [...] Can anyone help me in getting a generalised pattern from these? m/^ TAPI

Re: Pattern matching

2007-02-21 Thread Dr.Ruud
Dharshana Eswaran schreef: m/^ #TAPI (?:_[A-Z]+)+ $/x But this is filtering both the strings starting from TAPI and the strings starting from #TAPI. Yes, # starts a comment, so makes the regex equivalent to m/^/, which will allways match. echo 'abc' | perl -nle ' /^ # test/x and

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 directory then process them. I'm facing the

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]; beginners@perl.org Sent: Monday, February 12, 2007 12:46 PM Subject: RE: pattern match -Original

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 warnings; use Win32; use

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; my

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: use strict; use warnings; use Win32;

[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 successful

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

Re: Pattern Matching

2007-01-21 Thread Dharshana Eswaran
On 1/19/07, Igor Sutton [EMAIL PROTECTED] wrote: I have an update: my @data = $string =~ m/0x(\d{2})/g; my @data = $string =~ m/0x(\S{2}),?/g; Now I think it is right :) -- Igor Sutton Lopes [EMAIL PROTECTED] I used the above expression and it worked for me. Thanks you so much. Thanks

Re: Pattern Matching

2007-01-21 Thread Dharshana Eswaran
On 1/19/07, Rob Dixon [EMAIL PROTECTED] wrote: Igor Sutton wrote: I have an update: my @data = $string =~ m/0x(\d{2})/g; my @data = $string =~ m/0x(\S{2}),?/g; Now I think it is right :) my @data = $string =~ m/=0x(..)/g; :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Pattern Matching

2007-01-21 Thread Dharshana Eswaran
On 1/19/07, John W. Krahn [EMAIL PROTECTED] wrote: Dharshana Eswaran wrote: Hi All, Hello, I have a string as shown below: $string = {[0]=0x53,[1]=0x65,[2]=0x63,[3]=0x75,[4]=0x72,[5]=0x69,[6]=0x74,[7]=0x79,[8]=0x43,[9]=0x6F,[10]=0x64,[11]=0x65,[12]=0x00} This is stored as a string in

Re: Pattern Matching

2007-01-19 Thread Igor Sutton
Hi Dharshana, 2007/1/19, Dharshana Eswaran [EMAIL PROTECTED]: Hi All, I have a string as shown below: $string = {[0]=0x53,[1]=0x65,[2]=0x63,[3]=0x75,[4]=0x72,[5]=0x69,[6]=0x74,[7]=0x79,[8]=0x43,[9]=0x6F,[10]=0x64,[11]=0x65,[12]=0x00} This is stored as a string in a variable. I need to pull

Re: Pattern Matching

2007-01-19 Thread Igor Sutton
I have an update: my @data = $string =~ m/0x(\d{2})/g; my @data = $string =~ m/0x(\S{2}),?/g; Now I think it is right :) -- Igor Sutton Lopes [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Pattern Matching

2007-01-19 Thread Rob Dixon
Igor Sutton wrote: I have an update: my @data = $string =~ m/0x(\d{2})/g; my @data = $string =~ m/0x(\S{2}),?/g; Now I think it is right :) my @data = $string =~ m/=0x(..)/g; :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Pattern Matching

2007-01-19 Thread John W. Krahn
Dharshana Eswaran wrote: Hi All, Hello, I have a string as shown below: $string = {[0]=0x53,[1]=0x65,[2]=0x63,[3]=0x75,[4]=0x72,[5]=0x69,[6]=0x74,[7]=0x79,[8]=0x43,[9]=0x6F,[10]=0x64,[11]=0x65,[12]=0x00} This is stored as a string in a variable. I need to pull out only the numbers

Re: pattern substitution

2006-11-18 Thread D. Bolliger
Adriano Allora am Samstag, 18. November 2006 11:52: hi to all, Ciao Adriano I've got a list of tagged words, like this one (only a little bit longest): tLn nr=11 e CON e le DET:def il ha VER:presavere|riavere detto VER:pperdire NOM

Re: pattern substitution

2006-11-18 Thread John W. Krahn
Adriano Allora wrote: hi to all, Hello, I've got a list of tagged words, like this one (only a little bit longest): tLn nr=11 e CON e le DET:def il ha VER:presavere|riavere detto VER:pperdire NOM unknown CORRVER:inficorre

Re: pattern substitution

2006-11-18 Thread Rob Dixon
Adriano Allora wrote: hi to all, Hi Adriano. Read my comments in-line and my solution at the end. I've got a list of tagged words, like this one (only a little bit longest): tLn nr=11 e CON e le DET:def il ha VER:presavere|riavere detto VER:pperdire

Re: Pattern Matching

2006-07-24 Thread Rob Dixon
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: [EMAIL PROTECTED] wrote: Hi, I am a beginner in perl and am having a dickens of a time trying to identify this pattern in messages. [URL Here is what I have: if ($FORM{'message} =~ /\[URL/ig) { #do something; } Where

Re: Pattern Matching

2006-07-23 Thread John Ackley
[EMAIL PROTECTED] wrote: Hi, I am a beginner in perl and am having a dickens of a time trying to identify this pattern in messages. [URL Here is what I have: if ($FORM{'message} =~ /\[URL/ig) { #do something; } Where $FORM('message') is a messaage that includes many

Re: Pattern Matching

2006-07-23 Thread Jimstone77
In a message dated 7/23/2006 9:39:34 A.M. Pacific Standard Time, [EMAIL PROTECTED] writes: [EMAIL PROTECTED] wrote: Hi, I am a beginner in perl and am having a dickens of a time trying to identify this pattern in messages. [URL Here is what I have: if

Re: pattern matching

2006-07-18 Thread Rob Dixon
Ryan Dillinger wrote: Hello All, I was studying some pattern matching. And I ran into this piece of code. Now I believe I understand it up until the the last part \1. Can someone explain it for me please? Match lowercase a through z, uppercase A through lc z no more than three times, with white

Re: pattern matching

2006-07-18 Thread Dr.Ruud
Timothy Johnson schreef: You should south-post. You should trim. \1 is the same thing as $1 inside of a regex, but it is generally recommended that you don't use it. That is a misinterpretation. It is OK (and efficient) to use the backreferences \1, \2, \3 etc. in a regex. The \1 (as a

RE: pattern matching

2006-07-17 Thread Timothy Johnson
\1 is the same thing as $1 inside of a regex, but it is generally recommended that you don't use it. From 'perldoc perlre': Warning on \1 vs $1 Some people get too used to writing things like: $pattern =~ s/(\W)/\\\1/g; This is grandfathered for the RHS of a substitute to

Re: pattern matching

2006-07-17 Thread Tom Phoenix
On 7/17/06, Ryan Dillinger [EMAIL PROTECTED] wrote: Now I believe I understand it up until the the last part \1. /([a-zA-z]{3})\s*\1/ That's a backreference; it matches if the corresponding part of the string is equal to what's in memory one at the time of the match. Memory one holds the

Re: pattern matching

2006-07-17 Thread Alan_C
On Monday 17 July 2006 18:20, Timothy Johnson wrote: \1 is the same thing as $1 inside of a regex, but it is generally recommended that you don't use it. I thought it's ok to use it in a match or on the *left* side (but not on the right side) of a substitution then I'm stumped, what's the 1

Re: pattern matching

2006-07-17 Thread John W. Krahn
Ryan Dillinger wrote: Hello All, Hello, I was studying some pattern matching. And I ran into this piece of code. Now I believe I understand it up until the the last part \1. Can someone explain it for me please? Match lowercase a through z, uppercase A through lc z That must be a mistake

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 -- To

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 ( $ph ) {

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 10. I have changed

RE: pattern match

2006-07-11 Thread Timothy Johnson
At the moment I can't think of why this makes a difference (somebody help me here), but you aren't specifying a mode for the open() function. Also, you're not checking whether your match succeeded before using $1 (which is what I think you meant on that last line). I personally would write it a

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 have changed differernt things

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 have changed differernt things

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: $!; $_ = ; $_ = LYNX until /standard\.def/; If 'standard.def' is not found, this line loops forever. my $head = LYNX; $head =~ m|^A

Re: pattern matching problems

2006-07-08 Thread Mike Williams
Dr. Claus-Peter Becke wrote: foreach (/(\w+)/i) { push @words,$; } print$q-popup_menu('to_thesaurus', @words); this solution succeeds in finding and returning the last element... There are a few problems here: 1. regex should use the /g modifier to find all matches in the string

Re: pattern matching problems

2006-07-08 Thread Mumia W.
Dr. Claus-Peter Becke wrote: [...] foreach (/(\w+)/i) { push @words,$; } print$q-popup_menu('to_thesaurus', @words); [...] Use the /g (global) option to the match operator, and push $_ onto @words rather than $: foreach (/(\w+)/ig) { push @words, $_; } Or ditch the 'foreach'

Re: pattern matching problems

2006-07-08 Thread Mumia W.
Dr. Claus-Peter Becke wrote: dear mumia w., thank you for your support. i have chosen the simplest solution you recommanded. i still have one problem. i would like to print every word in a new line. push @woerter,/[a-zäöüß]/ig; print$q-li(@woerter); it's unfortunaltely impossible to

Re: Pattern Matching

2006-06-08 Thread anu p
Hi, Sorry, it was working, found out the problem was due to something else. Thanks, Anu. --- anu p [EMAIL PROTECTED] wrote: Hi, I have the following code snippet in which I open two files for read. For each line in file 1 (log.txt), I extract the test name, which is of format

Re: Pattern Matching Question

2005-11-28 Thread Dr.Ruud
Dax Mickelson schreef: I am having problems matching ALL possible matches of a string against another (very large) string. I am doing something like: @LargeArray = ($HugeString =~ m/$Head/ig); Where $Head is an 8 character string. (Basically I want to get all 16 character long

Re: Pattern Matching Question

2005-11-28 Thread Dr.Ruud
Dr.Ruud: #!/usr/bin/perl use strict; use warnings; { local ($,, $\) = (':', \n); $_ = 'AASDFGHJKL'; my $Head = ''; print $Head, $1, substr($',0,7) while /(?=$Head)(.)(?=.{7})/ig; } Revision: #!/usr/bin/perl use strict; use warnings; my

Re: Pattern Matching Question

2005-11-28 Thread Jeff 'japhy' Pinyan
On Nov 27, Dax Mickelson said: I am having problems matching ALL possible matches of a string against another (very large) string. I am doing something like: @LargeArray = ($HugeString =~ m/$Head/ig); Where $Head is an 8 character string. (Basically I want to get all 16 character

RE: Pattern Matching Question

2005-11-27 Thread S, karthik \(IE03x\)
Hope you are getting what you require.. If not, what you expect the result to be? With Best Regards, Karthikeyan S Honeywell Process Solutions - eRetail Honeywell Automation India Limited Phone:91-20-56039400 Extn -2701 Mobile :(0)9325118422 E-Mail: [EMAIL PROTECTED] This e-mail, and any

Re: Pattern Matching Question

2005-11-27 Thread John W. Krahn
Dax Mickelson wrote: I am having problems matching ALL possible matches of a string against another (very large) string. I am doing something like: @LargeArray = ($HugeString =~ m/$Head/ig); Where $Head is an 8 character string. (Basically I want to get all 16 character long

Re: pattern matching question - please help

2005-06-19 Thread MEENA SELVAM
Hi , in $prog =~ s/^.*\///; is it trying to substitute all characters until the last / within $prog? meena --- MEENA SELVAM [EMAIL PROTECTED] wrote: Hi, can anyone please explain? In the following code snippet, what is the meaning of the pattern match s/^.*\/// $prog = $0; $prog

Re: pattern matching question - please help

2005-06-19 Thread Chris Devers
On Sun, 19 Jun 2005, MEENA SELVAM wrote: can anyone please explain? See `perldoc perlre`, or `man perlre`, or a book like _Learning Perl_ or _Mastering Regular Expressions_ for this kind of thing. It's really an introductory question that any decent introductory text should be able to cover

Re: pattern matching question - please help

2005-06-19 Thread MEENA SELVAM
Hi Chris, Thanks for your detailed email and for your time. I think my second email crossed your email. The book I read on Perl did not mention anything about first and second half, and that didnt explain, me that we were replacing all upsto last / by nothing. I thought it is replacing with /

Re: Pattern Question: One or both, but not neither

2005-06-06 Thread Jeremy Vinding
Ing. Branislav Gerzo wrote: Jeremy Vinding [JV], on Friday, June 03, 2005 at 16:34 (-0600) has on mind: this will not match Florida, I think you meant: /(?:Tampa )?Florida|Tampa/ JV You caught me, but that matches Tampa Tampa too JV what I really meant was: JV /(?:(?:Tampa

Re: Pattern Question: One or both, but not neither

2005-06-06 Thread Jeremy Vinding
Jeremy Vinding wrote: Ing. Branislav Gerzo wrote: Jeremy Vinding [JV], on Friday, June 03, 2005 at 16:34 (-0600) has on mind: this will not match Florida, I think you meant: /(?:Tampa )?Florida|Tampa/ JV You caught me, but that matches Tampa Tampa too JV what I really meant was:

Re: Pattern Question: One or both, but not neither

2005-06-03 Thread Chris Devers
On Fri, 3 Jun 2005, Siegfried Heintze wrote: Can I write a pattern that matches Tampa or Florida, or Tampa Florida? I'm sure someone can. What happened when you tried it? You did try, right? -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

RE: Pattern Question: One or both, but not neither

2005-06-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Siegfried Heintze wrote: Can I write a pattern that matches Tampa or Florida, or Tampa Florida? Thanks, Siegfried You would have to order it so that if wanted Tampa Florida that would have priority over Tampa or Florida /(Tampa Florida|Tampa|Florida)/ one method. Wags ;)

Re: Pattern Question: One or both, but not neither

2005-06-03 Thread Jeremy Vinding
Wagner, David --- Senior Programmer Analyst --- WGO wrote: Siegfried Heintze wrote: Can I write a pattern that matches Tampa or Florida, or Tampa Florida? Thanks, Siegfried You would have to order it so that if wanted Tampa Florida that would have priority over Tampa or

Re: Pattern Question: One or both, but not neither

2005-06-03 Thread Ing. Branislav Gerzo
Jeremy Vinding [JV], on Friday, June 03, 2005 at 13:31 (-0600) typed the following: Can I write a pattern that matches Tampa or Florida, or Tampa Florida? JV you could also do: JV /(?:Tampa? Florida)|Tampa/ this will not match Florida, I think you meant: /(?:Tampa )?Florida|Tampa/ --

Re: Pattern matching problem

2005-05-10 Thread John Doe
Am Dienstag, 10. Mai 2005 11.01 schrieb Tielman Koekemoer (TNE): Hi all, I have tried various regular expressions to remove null or empty values on array @array1 and create a new array @OPD01 with the values. This, however, does not work as I still get a number of empty values in the @OPD01

Re: Pattern matching problem

2005-05-10 Thread Ing. Branislav Gerzo
Tielman Koekemoer (TNE) [TK], on Tuesday, May 10, 2005 at 11:01 (+0200) contributed this to our collective wisdom: TK I have tried various regular expressions to remove null or empty TK values on array @array1 and create a new array @OPD01 with the values. TK This, however, does not work as I

Re: Pattern matching problem

2005-05-10 Thread Kpramod
Hi John, Try to use 'chop' to get null value Thanks and Regards Pramod John Doe wrote: Am Dienstag, 10. Mai 2005 11.01 schrieb Tielman Koekemoer (TNE): Hi all, I have tried various regular expressions to remove null or empty values on array @array1 and create a new array @OPD01 with the values.

RE: Pattern matching problem

2005-05-10 Thread Tielman Koekemoer \(TNE\)
$counter2 = 0; What's that for? (never used) Hmm yeah sorry that was supposed to be $counter = 0; Use push() to avoid holding the current array index. What do you mean by holding the index? my @array1=(' ', 'a', '', 'b', \0, 'c', undef, 'd', ' ', 'e'); my @new=grep {$_ and !/^\s+$/ and

RE: Pattern matching problem

2005-05-10 Thread Tielman Koekemoer \(TNE\)
Ah I see: use push() to add scalars/lists to arrays. Thanks everyone for the help. Use push() to avoid holding the current array index. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: Pattern matching problem

2005-05-10 Thread John Doe
Am Dienstag, 10. Mai 2005 11.46 schrieb Tielman Koekemoer (TNE): $counter2 = 0; What's that for? (never used) Hmm yeah sorry that was supposed to be $counter = 0; Use push() to avoid holding the current array index. What do you mean by holding the index? remember (and incrementing) the

Re: Pattern matching problem

2005-05-10 Thread John Doe
Am Dienstag, 10. Mai 2005 11.23 schrieb Kpramod: Hi John, Try to use 'chop' to get null value Thanks and Regards Pramod Hi Pramad, sorry, I don't understand what you mean. Do you refer to the line my @new=grep {$_ and !/^\s+$/ and !/^\0+$/} @array1; (I see that the test for \0 is ugly,

Re: Pattern matching to identify comma separated text

2005-03-08 Thread Wiggins d'Anconia
Chris Schults wrote: I'm sending this on behalf of our intern Elmer. Thanks in advance for any assistance. Chris Hi there! If anyone out there is good with Perl's pattern matching, maybe you can help me out. I am trying to take a string and derive information from it that is separated by commas

Re: pattern matching

2005-03-02 Thread John W. Krahn
Aaron Reist wrote: From: John W. Krahn [EMAIL PROTECTED] Aaron Reist wrote: From: John W. Krahn [EMAIL PROTECTED] You could use a regular expression to do that. my $input = get_input_from_user(); $input =~ /\A(?:[[:alpha:]]([[:alnum:]]{9})[[:alpha:]]|(\d[[:alnum:]]{7}\d))\z/ and my

Re: pattern matching

2005-02-28 Thread John W. Krahn
Aaron Reist wrote: From: John W. Krahn [EMAIL PROTECTED] Aaron Reist wrote: Currently I have a simple program takes a username from a html textbox and checks against a list of values in a notepad document. If the name is found the user is given access, if not they are prompted to try again.

Re: pattern matching

2005-02-25 Thread John W. Krahn
Aaron Reist wrote: Hello everyone, Hello, not quite sure if what I m trying to do is possible, but here is the basic idea: Currently I have a simple program takes a username from a html textbox and checks against a list of values in a notepad document. If the name is found the user is given

Re: pattern matching

2005-02-24 Thread Ing. Branislav Gerzo
Aaron Reist [AR], on Friday, February 25, 2005 at 01:58 (-0500) typed the following: AR The program will check for two types of usernames - the first is #xxx# AR (9 alphanumeric characters. beginning and ending with a number)the AR second is XxX (11 alphanumeric charactors, the

  1   2   3   4   >