APM: Regex Question

David Bluestein II dbii at interaction.net
Mon Jun 26 06:32:25 PDT 2006


Tom-

That's it! Thanks, I couldn't remember the syntax but remembered it has  
something to do with ! or ? and parenthesis.

Solves my problem.

David

On Jun 26, 2006, at 5:08 AM, Thomas L. Shinnick wrote:

> At 01:29 AM 6/26/2006, David Bluestein II wrote:
>> Okay I want to do the following in this order:
>>
>>  s~(/nexres/reservations/application[^"])+~VALUE$1~g
>>  s~/nexres/reservations[^"]+~VALUE2~g
>>
>>  How do I construct REGEX #2 so that it doesn't match the result from
>>  #1? I need something like:
>>
>>  /nexres/reservations([^"]+) where $1 is not like '/a.*'
>>
>>  I know there is something like that, but don't remember the syntax.
>  If you wanted a negative look-ahead ...
>
>      while( <DATA> ) {
>          chomp;
>          printf "Saw '%s'\n", $_;
>          if ( s~(/nexres/reservations/application[^"]+)~/maybe1$1~g ) {
>              printf "RE 1 matched\n";
>          }
>          if (  
> s~(/nexres/reservations(?!/application)[^"]+)~/maybe2$1~g ) {
>              printf "RE 2 matched\n";
>          }
>          printf "Now '%s'\n", $_;
>      }
>  __DATA__
> http://reservation.indo.com/nexres/reservations/application=foo
> http://reservation.indo.com/nexres/reservations/input_dates.cgi? 
> src=10011323 "
>
>  Outputs:
>  Saw ' http://reservation.indo.com/nexres/reservations/application=foo'
>  RE 1 matched
>  Now '  
> http://reservation.indo.com/maybe1/nexres/reservations/application=foo  
> '
>  Saw '  
> http://reservation.indo.com/nexres/reservations/input_dates.cgi? 
> src=10011323 "'
>  RE 2 matched
>  Now  
> 'http://reservation.indo.com/maybe2/nexres/reservations/ 
> input_dates.cgi?src=10011323"
>
>  g'nite
>
>> Thanks-
>>
>>  David
>>   
>> ---------------------------------------------------------------------- 
>> -
>>  David H. Bluestein II
>>  President & Lead Developer         dbii at interaction.net
>>  ii, inc.                                                 
>> http://www.interaction.net
>>       -- Specializing in Interactive, Database Driven Websites  
>> --_______________________________________________
> Austin mailing list
> Austin at pm.org
> http://mail.pm.org/mailman/listinfo/austin
-----------------------------------------------------------------------
David H. Bluestein II
President & Lead Developer         dbii at interaction.net
ii, inc.                                                   
http://www.interaction.net
     -- Specializing in Interactive, Database Driven Websites --



More information about the Austin mailing list