Le Monday 30 June 2008 16:53:54 Support Desk, vous avez écrit : > Hello, > I am working on a web-app, that querys long distance numbers from a > database of call logs. I am trying to put together a regex that matches any > number that does not start with the following. Basically any number that > does'nt start with: > > > > 281 > > 713 > > 832 > > > > or > > > > 1281 > > 1713 > > 1832 > > > > > > is long distance any, help would be appreciated.
sounds like str.startswith() is enough for your needs: if not number.startswith(('281', '713', '832', ...)) : ... -- Cédric Lucantis -- http://mail.python.org/mailman/listinfo/python-list