RE: Problem with regular expressions!!!

2003-03-19 Thread Hanson, Rob
none). $test =~ /foo.*?bar/; Also... + = 1 or more (greedy) +? = 1 or more, non-greedy. Rob -Original Message- From: Rob Benton [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 2:07 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Problem with regular expressions!!! H

Re: Problem with regular expressions!!!

2003-03-19 Thread Rob Benton
How does it translate? * = 0 or more of preceding char ? = 1 or 0 of preceding char *? = ??? On Tue, 2003-03-18 at 21:41, Michael Kelly wrote: > On Tue, Mar 18, 2003 at 05:53:45PM -0600, Rob Benton wrote: > > It looks odd to me b/c * and ? are both quantifiers... > > * and ? alone are both quan

Re: Problem with regular expressions!!!

2003-03-19 Thread Michael Kelly
On Tue, Mar 18, 2003 at 05:53:45PM -0600, Rob Benton wrote: > It looks odd to me b/c * and ? are both quantifiers... * and ? alone are both quantifiers, but *? is a non-greedy *. -- Michael [EMAIL PROTECTED] http://www.jedimike.net/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

Re: Problem with regular expressions!!!

2003-03-18 Thread drieux
On Tuesday, Mar 18, 2003, at 15:46 US/Pacific, Peter Kappus wrote: I also had no problem... "myfile.jpeg" =~ /(.*?)\.(.*)/; print $2; gives me "jpeg" Can we see the rest of your code? I think the problem may be in the value of $file_completename... [..] I think the OP may have a problem with wh

Re: Problem with regular expressions!!!

2003-03-18 Thread Wiggins d'Anconia
Hughes, Andrew wrote: This is a newbie observation, but aren't you not supposed to name one of your own variables with a number as the first value after a $, @, or % as in the case of $2? Could this be part of the problem? Just to make sure this doesn't slip through, in his case $2 refers to th

RE: Problem with regular expressions!!!

2003-03-18 Thread Peter Kappus
I also had no problem... "myfile.jpeg" =~ /(.*?)\.(.*)/; print $2; gives me "jpeg" Can we see the rest of your code? I think the problem may be in the value of $file_completename... -Peter -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Problem with regular expressions!!!

2003-03-18 Thread Marcelo Taube
ll keep looking at it. A questio: Should the 'split' version of the same code be faster? Original Message Follows From: "Kipp, James" <[EMAIL PROTECTED]> To: "'Marcelo Taube'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject: RE: Problem

Re: Problem with regular expressions!!!

2003-03-18 Thread Rob Benton
It looks odd to me b/c * and ? are both quantifiers which usually triggers an error when you try to run it. See if this works for you: $file_completename =~ /([^.]*)\.(.*)/; On Tue, 2003-03-18 at 15:28, Marcelo Taube wrote: > As u probably have guessed some part of my code is not working proper

Re: Problem with regular expressions!!!

2003-03-18 Thread Brett W. McCoy
On Tue, 18 Mar 2003, Marcelo Taube wrote: > As u probably have guessed some part of my code is not working properly and > i don't understand why!! > > This is the code. > # > $file_completename =~ /(.*?)\.(.*)/; > if ($2 eq $extension]) { > #DO SOMETHING!!! >

RE: Problem with regular expressions!!!

2003-03-18 Thread Kipp, James
> > This is the code. > # > $file_completename =~ /(.*?)\.(.*)/; > if ($2 eq $extension]) { > #DO SOMETHING!!! > } > # did u turn on warnings and use strict ?? did you catch the ] at the end of $extension? i tried this on

RE: Problem with regular expressions!!!

2003-03-18 Thread Hughes, Andrew
esday, March 18, 2003 4:29 PM To: [EMAIL PROTECTED] Subject: Problem with regular expressions!!! As u probably have guessed some part of my code is not working properly and i don't understand why!! This is the code. # $file_completename =~ /(.*?)\.(.*)/;

Problem with regular expressions!!!

2003-03-18 Thread Marcelo Taube
As u probably have guessed some part of my code is not working properly and i don't understand why!! This is the code. # $file_completename =~ /(.*?)\.(.*)/; if ($2 eq $extension]) { #DO SOMETHING!!! } # As u see, i'm trying