Re: regex matching conditionally

2006-04-18 Thread Jay Savage
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

Fwd: regex matching conditionally

2006-04-15 Thread Jay Savage
-- 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:

Re: regex matching conditionally

2006-04-15 Thread John W. Krahn
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

Re: regex matching conditionally

2006-04-15 Thread Dr.Ruud
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

Re: regex matching conditionally

2006-04-14 Thread JupiterHost.Net
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!

Re: regex matching conditionally

2006-04-14 Thread Jay Savage
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

RE: regex matching conditionally

2006-04-14 Thread Timothy Johnson
-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 >>

Re: regex matching conditionally

2006-04-14 Thread JupiterHost.Net
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-

Re: regex matching conditionally

2006-04-14 Thread JupiterHost.Net
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

Re: regex matching conditionally

2006-04-13 Thread Randy W. Sims
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

Re: regex matching conditionally

2006-04-13 Thread JupiterHost.Net
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

RE: regex matching conditionally

2006-04-13 Thread Timothy Johnson
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

regex matching conditionally

2006-04-13 Thread JupiterHost.Net
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