Personally, I'd use a hash.  First, populate a hash of good node values
like this:

 foreach (1, 2, 3, 4) {    # Good node values
   $goodNode{$_} = 1;      # Set to "true"
 }

Then for each node you find in the file, test against %goodNode:

 if ($goodNode{$questionableNode}) { success }

Good Luck!
Matt

-----Original Message-----
From: Qiang Qiang [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 07, 2001 10:46 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: To read from a file using RegExp


I have a file as follows:

.SUBCKT JTJTAG Z@@793 Z@@753 Z@@109 Z@@86 Z@@15 Z@@296 Z@@61 Z@@207
Z@@135
+ Z@@275 Z@@313 Z@@1134 Z@@232 Z@@184 Z@@162 Z@@976 Z@@1014 Z@@253 
+ Z@@954
Z@@39
+  Z@@138 Z@@622 Z@@1060 Z@@405 Z@@368 Z@@735

"Z@@xxx" stands for a node.

What I need to do is that read every node in the file and compare
everyone 
with a given node to see whether it is in this file.  What can I do
using 
RegExp?  Thanks:-)


_________________________________________________________________
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to