Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Neil Cerutti Newsgroups: comp.lang.python Subject: Re: Regular expression negative look-ahead Date: 2 Jul 2013 12:15:10 GMT Organization: Norwich University Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net R6s/2lyNs5etOXpTyy4F6QHnOzGuc277tI/Aottv9WyEfYRXpg Cancel-Lock: sha1:8dU4UjirITvyEymQNccukjwz5hs= User-Agent: slrn/0.9.9p1/mm/ao (Win32) Xref: csiph.com comp.lang.python:49635 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 > YOUR_TABLE Use the "is not a word" character class on either end. r"\WMY_TABLE\W" r"\WYOUR_TABLE\W" -- Neil Cerutti