Re: Help with regular expressions

2011-05-10 Thread Tiago Hori
> > Hasn't someone already fixed this problem? If there isn't a CPAN module > to > > perform standardized bibliographic reference formatting/parsing. I > haven't > > looked at CPAN; did either of you? If a CPAN module doesn't exist, one > > should! > > > > What standard? > > Kalthoff K (2001) An

Re: Help with regular expressions

2011-05-09 Thread Brian Fraser
On Mon, May 9, 2011 at 6:35 PM, Kenneth Wolcott wrote: > Hasn't someone already fixed this problem? If there isn't a CPAN module to > perform standardized bibliographic reference formatting/parsing. I haven't > looked at CPAN; did either of you? If a CPAN module doesn't exist, one > should! >

Re: Help with regular expressions

2011-05-09 Thread Kenneth Wolcott
On Mon, May 9, 2011 at 12:04, Sandip Bhattacharya < sand...@foss-community.com> wrote: > On Mon, May 9, 2011 at 11:44 PM, Tiago Hori wrote: > > I am trying to write a small script to parse bibliographic references > like > > this: > > > > Morgan, M.J., Wilson, C.E., Crim, L.W., 1999. The effect o

Re: Help with regular expressions

2011-05-09 Thread Sandip Bhattacharya
On Mon, May 9, 2011 at 11:44 PM, Tiago Hori wrote: > I am trying to write a small script to parse bibliographic references like > this: > > Morgan, M.J., Wilson, C.E., Crim, L.W., 1999. The effect of stress on > reproduction in Atlantic cod. J. Fish Biol. 54, 477-488. > > What I want to be able to

Help with regular expressions

2011-05-09 Thread Tiago Hori
Hi List, I am trying to write a small script to parse bibliographic references like this: Morgan, M.J., Wilson, C.E., Crim, L.W., 1999. The effect of stress on reproduction in Atlantic cod. J. Fish Biol. 54, 477-488. What I want to be able to do eventually is parse each name separately and assoc

Re: very new - need help with regular expressions

2005-04-12 Thread M. Kristall
John W. Krahn wrote: M. Kristall wrote: John W. Krahn wrote: As long as you realise that putting a space between the operator name and the left parenthesis may trigger a warning when warnings are enabled. (And you DO have warnings enabled, don't you?) $ perl -le'use warnings; print( 1,2,3,4,5 )

Re: very new - need help with regular expressions

2005-04-11 Thread John W. Krahn
M. Kristall wrote: John W. Krahn wrote: As long as you realise that putting a space between the operator name and the left parenthesis may trigger a warning when warnings are enabled. (And you DO have warnings enabled, don't you?) $ perl -le'use warnings; print( 1,2,3,4,5 )' 12345 $ perl -le'us

Re: very new - need help with regular expressions

2005-04-11 Thread M. Kristall
John W. Krahn wrote: M. Kristall wrote: John W. Krahn wrote: open INPUT, '<', 'record.txt' or die "Error, can't open 'record.txt' $!"; while ( ) { next unless /^\?/; print "$1\n" if /<([^>]+)>/; } close INPUT; We want some line numbers (and I like parens): As long as you realise th

Re: very new - need help with regular expressions

2005-04-11 Thread John W. Krahn
M. Kristall wrote: John W. Krahn wrote: open INPUT, '<', 'record.txt' or die "Error, can't open 'record.txt' $!"; while ( ) { next unless /^\?/; print "$1\n" if /<([^>]+)>/; } close INPUT; We want some line numbers (and I like parens): As long as you realise that putting a space betwee

Re: very new - need help with regular expressions

2005-04-11 Thread M. Kristall
John W. Krahn wrote: Brett Williams wrote: Hi :) Hello, I am still very new to perl (and programming) and am getting stuck with regular expressions. I have a text file in which I want to find, then print to screen all lines beginning with "?" and then print the text between the "<" and ">" char

Re: very new - need help with regular expressions

2005-03-27 Thread Zeus Odin
"Brett Williams" <[EMAIL PROTECTED]> wrote in message ... > > That was a big help. I now have another problem however. I had assumed > that adding a line number preceding the prices would be a trivial > matter, however what i thought would work is not doing so. Here is the > code ive tried. > > [sn

Re: very new - need help with regular expressions

2005-03-26 Thread John W. Krahn
Brett Williams wrote: Hi :) Hello, I am still very new to perl (and programming) and am getting stuck with regular expressions. I have a text file in which I want to find, then print to screen all lines beginning with "?" and then print the text between the "<" and ">" characters. The code I hav

RE: very new - need help with regular expressions

2005-03-26 Thread Chris Heiland
> -Original Message- > From: Manav Mathur [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 26, 2005 5:33 AM > To: Brett Williams; beginners@perl.org > Subject: RE: very new - need help with regular expressions > > > > > |-Original Message- &

RE: very new - need help with regular expressions

2005-03-26 Thread Manav Mathur
|-Original Message- |From: Brett Williams [mailto:[EMAIL PROTECTED] |Sent: Saturday, March 26, 2005 3:01 PM |To: beginners@perl.org |Subject: re: very new - need help with regular expressions | | |Thank you Manav :) | |That was a big help. I now have another problem however. I had

Re: very new - need help with regular expressions

2005-03-26 Thread Steven Schubiger
> chomp($line); It's superfluous in this peculiar case, by the way. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: very new - need help with regular expressions

2005-03-26 Thread Steven Schubiger
On 26 Mar, Brett Williams wrote: > What i would like is for the output to look like > > 1: 1002.00 > 2: 125.00 > 3: 61864.35 > 4: 890876.99 > 5: 9.99 > > but perl doesn't like my code. #! /usr/bin/perl use strict; use warnings; my $lnum = 1; while (my $line = ) { next unless $line =~ /\d+

re: very new - need help with regular expressions

2005-03-26 Thread Brett Williams
Thank you Manav :) That was a big help. I now have another problem however. I had assumed that adding a line number preceding the prices would be a trivial matter, however what i thought would work is not doing so. Here is the code ive tried. (open(INPUT, "record.txt")) or die("Error, can't find

very new - need help with regular expressions

2005-03-26 Thread Brett Williams
Hi :) I am still very new to perl (and programming) and am getting stuck with regular expressions. I have a text file in which I want to find, then print to screen all lines beginning with "?" and then print the text between the "<" and ">" characters. The code I have tried (amongst many varia

Re: Help with regular expressions within a split statement

2002-09-26 Thread Jeff 'japhy' Pinyan
On Sep 26, John W. Krahn said: >Shaun Bramley wrote: >> >> I have data that for some god foresaken reason is using two or three methods >> of delimitting names. Some are delimitted using '//' others with ';'. >> >> I have tried using @names = split( /(;)|(\/\/)/, $authors[$x]); however >> this

Re: Help with regular expressions within a split statement

2002-09-26 Thread John W. Krahn
Shaun Bramley wrote: > > I have data that for some god foresaken reason is using two or three methods > of delimitting names. Some are delimitted using '//' others with ';'. > > I have tried using @names = split( /(;)|(\/\/)/, $authors[$x]); however > this doesn't have the intended result. >

Re: Help with regular expressions within a split statement

2002-09-25 Thread Rohit Mishra-R53658
This should work split(/[;\/]+/,$authors[$x]) Shaun Bramley wrote: > I have data that for some god foresaken reason is using two or three methods > of delimitting names. Some are delimitted using '//' others with ';'. > > I have tried using @names = split( /(;)|(\/\/)/, $authors[$x]); howeve

RE: Help with regular expressions within a split statement

2002-09-25 Thread Timothy Johnson
Does this work? split(/(;|\/+)/,$authors[$x]) -Original Message- From: Shaun Bramley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 25, 2002 10:01 PM To: [EMAIL PROTECTED] Subject: Help with regular expressions within a split statement I have data that for some god foresaken

Help with regular expressions within a split statement

2002-09-25 Thread Shaun Bramley
I have data that for some god foresaken reason is using two or three methods of delimitting names. Some are delimitted using '//' others with ';'. I have tried using @names = split( /(;)|(\/\/)/, $authors[$x]); however this doesn't have the intended result. Is this possible? or am I doing som

Re: Help with regular expressions

2002-08-16 Thread Connie Chan
- Original Message - From: "pn" <[EMAIL PROTECTED]> To: "prl_list" <[EMAIL PROTECTED]> Sent: Friday, August 16, 2002 7:24 PM Subject: Re: Help with regular expressions > > > I ran into the following Regular expressions, but am > unable

Re: Help with regular expressions

2002-08-16 Thread pn
I ran into the following Regular expressions, but am unable to quite understand what each of these mean: Any help would be greatly appreciated, as I am fairly new to PERL. 1) $abc=~/my_sdk\s+\-name\s+\{(\S+)\}\s+\-pid\s+(\S+)\s+\-wfm\s+\{\s*(\S+)\s+(\S+)\s*\}.*/gi) 2) $line=~/(\S+)\s+(\S+)\s