[prev in list] [next in list] [prev in thread] [next in thread]
List: ast-users
Subject: Re: [ast-users] xgrep syntax examples?
From: Glenn Fowler <gsf () research ! att ! com>
Date: 2010-03-01 16:23:31
Message-ID: 201003011623.o21GNVuh031071 () penguin ! research ! att ! com
[Download RAW message or body]
RE negation is non-intuitive
but I believe the implementation is correct
the non-intuitive part is this:
then negation of (123)! is *all* substrings that do not match 123
e.g., 12 matches (123)!
the reason is that RE+negation must be closed under its operations
the closure of a negation can be a large space for some patterns
to see what is going on express your tests as testregex test cases
I'll start you off with the following "negation.dat"
we can expand it on the list here and then I'll put it in a future release
be sure to preserve the <TAB>s
and run like this
testregex negation.dat
---
: X/Open regex negation tests 2010-03-01
A (123)! 123 (0,2)
K !(123) 123 (0,2)(0,2)
A (...)&(123)! 123 NOMATCH
K @(???)&(!(123)) 123 NOMATCH
A (12)! 123 (0,3)
K !(12) 123 (0,3)(0,3)
_______________________________________________
ast-users mailing list
ast-users@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic