Re: Regular expression negative look-ahead

2013-07-03 Thread Jason Friedman
Huh, did not realize that endswith takes a list. I'll remember that in the future. This need is actually for http://schemaspy.sourceforge.net/, which allows one to include only tables/views that match a pattern. Either there is a bug in Schemaspy's code or Java's implementation of regular expres

Re: Regular expression negative look-ahead

2013-07-03 Thread Jason Friedman
> Huh, did not realize that endswith takes a list. I'll remember that in > the future. > > This need is actually for http://schemaspy.sourceforge.net/, which allows > one to include only tables/views that match a pattern. > > Either there is a bug in Schemaspy's code or Java's implementation of >

Re: Regular expression negative look-ahead

2013-07-02 Thread Neil Cerutti
On 2013-07-01, Jason Friedman wrote: > > I have table names in this form: > MY_TABLE > MY_TABLE_CTL > MY_TABLE_DEL > MY_TABLE_RUN > YOUR_TABLE > YOUR_TABLE_CTL > YOUR_TABLE_DEL > YOUR_TABLE_RUN > > I am trying to create a regular expression that will return true for only > these tables: > MY_TABLE

Regular expression negative look-ahead

2013-07-02 Thread Jason Friedman
I have table names in this form: MY_TABLE MY_TABLE_CTL MY_TABLE_DEL MY_TABLE_RUN YOUR_TABLE YOUR_TABLE_CTL YOUR_TABLE_DEL YOUR_TABLE_RUN I am trying to create a regular expression that will return true for only these tables: MY_TABLE YOUR_TABLE I tried these: pattern = re.compile(r"_(?!(CTL|DEL|R

Re: Regular expression negative look-ahead

2013-07-01 Thread Ian Kelly
On Mon, Jul 1, 2013 at 8:27 PM, Jason Friedman wrote: > Found this: > http://stackoverflow.com/questions/13871833/negative-lookahead-assertion-not-working-in-python. > > This pattern seems to work: > pattern = re.compile(r"^(?!.*(CTL|DEL|RUN))") > > But I am not sure why. > > > On Mon, Jul 1, 2013

Re: Regular expression negative look-ahead

2013-07-01 Thread Jason Friedman
Found this: http://stackoverflow.com/questions/13871833/negative-lookahead-assertion-not-working-in-python . This pattern seems to work: pattern = re.compile(r"^(?!.*(CTL|DEL|RUN))") But I am not sure why. On Mon, Jul 1, 2013 at 5:07 PM, Jason Friedman wrote: > I have table names in this form