On 4/18/06, Jenda Krynicky <[EMAIL PROTECTED]> wrote:
> From: "Jay Savage" <[EMAIL PROTECTED]>
> > On 4/14/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > Timothy Johnson wrote:
> > > > Will the string always have the two quotes in the same place and
> > > > only one per string? W
-- Forwarded message --
From: Jay Savage <[EMAIL PROTECTED]>
Date: Apr 15, 2006 2:58 PM
Subject: Re: regex matching conditionally
To: "John W. Krahn" <[EMAIL PROTECTED]>
On 4/15/06, John W. Krahn <[EMAIL PROTECTED]> wrote:
> Jay Savage wrote:
Jay Savage wrote:
> On 4/14/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
>>
>>Timothy Johnson wrote:
>>>Will the string always have the two quotes in the same place and only
>>>one per string? What about something like this?
>>>
>>>/.*?\{([^\}]*)\}(?=.*")/gi
>>I tested it out and it appears to b
Timothy Johnson schreef:
> /.*?\{([^\}]*)\}(?=.*")/gi
There is no need to escape a } in a character class.
Something like
[^x]*x
can also be written as
.*?x
The "/i" modifier is superfluous. The last .* can also be minimalized.
So an alternative is:
/ [{] (.*?) [}] (?=.*?") /xg
Jay Savage wrote:
On 4/14/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
Timothy Johnson wrote:
Will the string always have the two quotes in the same place and only
one per string? What about something like this?
/.*?\{([^\}]*)\}(?=.*")/gi
I tested it out and it appears to be perect!
On 4/14/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
>
>
> Timothy Johnson wrote:
> > Will the string always have the two quotes in the same place and only
> > one per string? What about something like this?
> >
> > /.*?\{([^\}]*)\}(?=.*")/gi
>
> I tested it out and it appears to be perect! Than
-Original Message-
From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
Sent: Friday, April 14, 2006 12:15 PM
To: beginners@perl.org
Subject: Re: regex matching conditionally
>Timothy Johnson wrote:
>> Will the string always have the two quotes in the same place and only
>>
Timothy Johnson wrote:
Will the string always have the two quotes in the same place and only
one per string? What about something like this?
/.*?\{([^\}]*)\}(?=.*")/gi
I tested it out and it appears to be perect! Thank Mr. Johnson :)
I love when I learn a new tidbit!
--
To unsubscribe, e-
Not what you asked for, but probably more correct:
my @matches;
use Regexp::Common;
my @quoted = ($string =~ /$RE{quoted}/g);
foreach my $quoted ( @quoted ) {
push( @matches, ($quoted =~ /$RE{balanced}{-parens=>'{}'}/g) );
}
print join "\n", @matches;
Thanks, it was the same sort of i
JupiterHost.Net wrote:
Howdy list,
I'm trying to see if I can do this in one regex instead of multiple
stage, mainly for educational purposes since I already have it in
multipel steps.
I am trygin to get each string between { and } where the {} occurs
between double quotes. So with
"file
ct string, I'll have to study it a bit, thanks!
-Original Message-
From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 13, 2006 5:16 PM
To: beginners@perl.org
Subject: regex matching conditionally
Howdy list,
I'm trying to see if I can do this in one regex i
bject: regex matching conditionally
Howdy list,
I'm trying to see if I can do this in one regex instead of multiple
stage, mainly for educational purposes since I already have it in
multipel steps.
I am trygin to get each string between { and } where the {} occurs
between double quote
Howdy list,
I'm trying to see if I can do this in one regex instead of multiple
stage, mainly for educational purposes since I already have it in
multipel steps.
I am trygin to get each string between { and } where the {} occurs
between double quotes. So with
"file.optcondition={/Root/Get
13 matches
Mail list logo