[ale] Yet another regex question

Jason Day jasonday at worldnet.att.net
Tue Aug 16 11:56:44 EDT 2005


On Sat, Aug 13, 2005 at 05:53:16AM -0400, Christopher Fowler wrote:
> On Sat, 2005-08-13 at 02:48 -0400, Jim Popovitch wrote:
[snip]
> > 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) 
> 
> I think the problem with that is that it requires something to be before
> the X.  Something has to be there but no space.  I'm using perl to test
> the ideas.

Try "[^ ]?XMI001".  That should match the string "XMI001" optionally
preceded by any character that is not a space.  If you want to match 0
or more non-spaces, use "[^ ]*XMI001".
-- 
Jason Day                                       jasonday at
http://jasonday.home.att.net                    worldnet dot att dot net
 
"Of course I'm paranoid, everyone is trying to kill me."
    -- Weyoun-6, Star Trek: Deep Space 9



More information about the Ale mailing list