Re: regex help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?utf-8?q?C=C3=A9dric_Lucantis?=

    Re: regex help

    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.startswi th(('281', '713', '832', ...)) :
    ...

    --
    Cédric Lucantis
Working...