Reg Exp Help

Discussion in 'Perl' started by PerlE, Jan 30, 2004.

  1. PerlE

    PerlE Guest

    Hi,
    I have data in a file in two column formats, which I am trying to search and
    match for certain expressions.
    Data is as such:
    foo1 foo1[ ]
    foo2 foo2( )
    bar1 bar1( ) ( )
    bar2 [ ][ ]
    …I want to be able to search for the followings by reading this file:
    Please note that the issue is "[ ]" and "( )" and not the words in front of
    them.
    ignore[m][n]
    ignore1(m) [n]
    ignore2[m] (n)
    ignore3(m) (n)
    ignore4[m] ß--------Done, refer below
    ignore5(m)[x:y]
    ignore6[m][x:y]
    ignore7[m](x:y)
    ignore8(m)(x:y)
    # I have done pattern match for foo1 foo1[ ]; as shown below
    if (
    /^\s*([\w|\/|\#]+)\s+([\w|\/|\#]+)\s*\[([^\]]+)\]\s*;/ ){
    print “ Found [ ] categories”;}
    I need similar one-liners for other combination above. it keeps complaining
    about using “(“ as delimiter !!!
    Thank You.
    B
    PerlE, Jan 30, 2004
    #1
    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 Rowland

    Reg exp: matching relative path only.

    Andrew Rowland, Aug 2, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,132
    Andrew Rowland
    Aug 2, 2003
  2. Aristotle

    Help needed with reg exp please

    Aristotle, Sep 4, 2004, in forum: Perl
    Replies:
    4
    Views:
    468
    Gunnar Hjalmarsson
    Sep 4, 2004
  3. GrelEns

    help with cr in reg exp...

    GrelEns, Jan 17, 2004, in forum: Python
    Replies:
    1
    Views:
    289
    Peter Otten
    Jan 17, 2004
  4. Jim

    reg exp help

    Jim, Jul 27, 2004, in forum: Python
    Replies:
    5
    Views:
    365
    Christopher T King
    Jul 27, 2004
  5. aekalman
    Replies:
    6
    Views:
    118
    Ben Morrow
    Nov 22, 2004
Loading...

Share This Page