Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Reg Exp Help

Reply
Thread Tools

Reg Exp Help

 
 
PerlE
Guest
Posts: n/a
 
      01-30-2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Complex Pattern Extraction with Key/Value Pairs and Reg Exp? aekalman Perl Misc 6 11-22-2004 10:59 PM
Help needed with reg exp please Aristotle Perl 4 09-04-2004 05:38 PM
reg exp help Jim Python 5 07-27-2004 08:42 PM
help with cr in reg exp... GrelEns Python 1 01-17-2004 11:35 AM
Reg exp: matching relative path only. Andrew Rowland Perl 0 08-01-2003 11:14 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57