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

[ale] Yet another regex question



On Fri, 2005-08-12 at 21:29 -0400, Christopher Fowler wrote: 
> I guess what I'm asking is if there is a way to catch 'XMI001' instead
> of '%\sXMI001' without using the anchors

How about using "[^ ]XMI001" where the brackets contain a (set of) valid
character(s) to match against, but in this case a leading carrot '^' in
the brackets indicates that we do NOT want to match against the set of
characters.

So, a regmatch of "[^ ]XMI001" would match "XMI001" and "zXMI001" but
not " XMI001" since the brackets contain a negated space (i.e. no space
before XMI001) 

Make sense?

-Jim P.

> 
> 
> On Fri, 2005-08-12 at 20:12 -0400, Christopher Fowler wrote:
> > On Fri, 2005-08-12 at 20:02 -0400, Jim Popovitch wrote:
> > > Just use this '^ABCDEF', the carrot '^' means beginning of line, the
> > > dollar sign '$' means end of line.
> > 
> > Yea I tested that but the regex processor does not seem to see lines?
> > The program that looks at the data was written in C and is using the
> > regex engine in libc.  
> > 
> > > 
> > > -Jim P.
> > > 
> > > On Fri, 2005-08-12 at 19:24 -0400, Christopher Fowler wrote:
> > > > I'm trying to create a regex that will catch only the string 'ABCDEF'
> > > > If the string is '% ABCDEF' I do not want the POSIX regex engine to
> > > > catch.  Is there a way I can create a regex that will ignore 'ABCDEF' if
> > > > it it preceeded with a '%\s'?  The \s is a space.
> > > > 
> > > > Thanks,
> > > > Chris
> > > > 
> > > > _______________________________________________
> > > > Ale mailing list
> > > > Ale at ale.org
> > > > http://www.ale.org/mailman/listinfo/ale
> > > 
> > > _______________________________________________
> > > Ale mailing list
> > > Ale at ale.org
> > > http://www.ale.org/mailman/listinfo/ale
> > 
> > _______________________________________________
> > Ale mailing list
> > Ale at ale.org
> > http://www.ale.org/mailman/listinfo/ale
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale