regexp

William Park opengeometry-FFYn/CNdgSA at public.gmane.org
Sat Apr 24 21:44:48 UTC 2004


On Sat, Apr 24, 2004 at 02:43:33PM -0400, John Macdonald wrote:
> > > abc=def and anything else instead of def, but not:

> > > abc=fgh

> > > /abc=!(fgh)
> > 
> > In shell,
> >     shopt extglob
> > In others,
> >     abc=[^f][^g][^h]
> 
> That will reject "abc=deh" which I'd include in the
> specified "def and anything else".  You need:
> 
>      /abc=(([a-eg-z][a-z][a-z])|([a-z][a-fh-z][a-z])|([a-z][a-z][a-gi-z]))/
> 
> It gets even messier if you also want to allow
> other than exactly 3 lower case letters to be in the
> assigned value.

My misreading.  Hmm...
    ([^f]..|f[^g].|fg[^h])
    ([^f]..|.[^g].|..[^h])

-- 
William Park, Open Geometry Consulting, <opengeometry-FFYn/CNdgSA at public.gmane.org>
Linux solution/training/migration, Thin-client
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list