No doubt I should know this regex point but ..

Discussion in 'Python' started by Jim Hefferon, Aug 14, 2003.

  1. Jim Hefferon

    Jim Hefferon Guest

    I am writing a class that walks through a file tree and (among other things)
    filters out which files it considers. So I want to have
    __init__( .. ,filterExpression='..')
    For the default I want to filter nothing. So I need a Python regular expression
    that never matches. What is (the best) one?

    Thanks for any help,
    Jim
     
    Jim Hefferon, Aug 14, 2003
    #1
    1. Advertising

  2. Jim Hefferon

    Aahz Guest

    In article <>,
    Jim Hefferon <> wrote:
    >
    >I am writing a class that walks through a file tree and (among other things)
    >filters out which files it considers. So I want to have
    > __init__( .. ,filterExpression='..')
    >For the default I want to filter nothing. So I need a Python regular
    >expression that never matches. What is (the best) one?


    None

    Seriously, make the default None, and test for it before trying a regex.
    --
    Aahz () <*> http://www.pythoncraft.com/

    This is Python. We don't care much about theory, except where it intersects
    with useful practice. --Aahz
     
    Aahz, Aug 14, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    794
    Reedick, Andrew
    Jul 1, 2008
  2. Saraswati lakki
    Replies:
    0
    Views:
    1,371
    Saraswati lakki
    Jan 6, 2012
  3. Tman
    Replies:
    3
    Views:
    87
  4. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    253
    Gregory Toomey
    Apr 23, 2004
  5. Aseem Bansal
    Replies:
    22
    Views:
    248
    Schneider
    Sep 26, 2013
Loading...

Share This Page