Regular Expression Question

Discussion in 'Perl' started by Geoff Robinson, Nov 21, 2003.

  1. Hello,

    I need a regular expression that will match all files which aren't of
    two extensions. Basicly I need it to mean not *.a nor *.csv.

    The best I can come up with based on books and online sources is
    [^[*.m][*.csv]] but that doesn't look quite right.

    Does anyone know what the proper regular expression is?

    thanks for any help in advance,
    Geoff
     
    Geoff Robinson, Nov 21, 2003
    #1
    1. Advertising

  2. Geoff Robinson

    dw Guest

    "Geoff Robinson" <> wrote in message
    news:...
    > Hello,
    >
    > I need a regular expression that will match all files which aren't of
    > two extensions. Basicly I need it to mean not *.a nor *.csv.
    >
    > The best I can come up with based on books and online sources is
    > [^[*.m][*.csv]] but that doesn't look quite right.


    not matching *.a or *.csv:

    ! /\.(a|csv)$/
     
    dw, Nov 21, 2003
    #2
    1. Advertising

  3. thanks

    "dw" <> wrote in message news:<hswvb.2299$>...
    > "Geoff Robinson" <> wrote in message
    > news:...
    > > Hello,
    > >
    > > I need a regular expression that will match all files which aren't of
    > > two extensions. Basicly I need it to mean not *.a nor *.csv.
    > >
    > > The best I can come up with based on books and online sources is
    > > [^[*.m][*.csv]] but that doesn't look quite right.

    >
    > not matching *.a or *.csv:
    >
    > ! /\.(a|csv)$/
     
    Geoff Robinson, Nov 22, 2003
    #3
    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. Andrew Munn

    Regular expression question...

    Andrew Munn, Jun 29, 2003, in forum: Perl
    Replies:
    1
    Views:
    2,136
    rakesh sharma
    Jun 30, 2003
  2. Glenn Kidd

    Regular expression question

    Glenn Kidd, Aug 18, 2003, in forum: Perl
    Replies:
    0
    Views:
    932
    Glenn Kidd
    Aug 18, 2003
  3. VSK
    Replies:
    2
    Views:
    2,305
  4. =?iso-8859-1?B?bW9vcJk=?=

    Matching abitrary expression in a regular expression

    =?iso-8859-1?B?bW9vcJk=?=, Dec 1, 2005, in forum: Java
    Replies:
    8
    Views:
    851
    Alan Moore
    Dec 2, 2005
  5. GIMME
    Replies:
    3
    Views:
    11,973
    vforvikash
    Dec 29, 2008
Loading...

Share This Page