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
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
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
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
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
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]
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
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
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!!!
>
>
> 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
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?
Andrew
-Original Message-
From: Marcelo Taube [mailto:[EMAIL PROTECTED]
Sent: Tuesday,
11 matches
Mail list logo