Kevin Falcone on Fri, 2 Feb 2001 09:50:30 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] regexp???


>>>>> "WM" == Walt Mankowski <waltman@netaxs.com> writes:

  WM> On Thu, Feb 01, 2001 at 07:41:41PM -0500, MaD dUCK wrote:
  >> how can i create a regexp which will match anystring of the form
  >> "the xxxxxx is big"
  >> unless xxxxxx is "house"

  WM> In Perl you could say

  WM>    if (/the (.*) is big/ && $1 ne 'house')

I'm not sure if this is uglier or prettier, but it lets me show off
the negative look-ahead assertion operator which is cute.

if (/the (?!house).* is big/)

-kevin

-- 
Fear leads to anger. Anger leads to throwing a hissy fit, which gets
you a cola.  Cool, huh?  --User Friendly


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug