Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl Pattern Matching !!! Help

Status
Not open for further replies.

maxmave

Programmer
Jun 3, 2008
5
US
Hello

I got the below one from in one of this forums

For Ex: Loading File System Networking in nature

now i need to extract the patterns between the words File and Networking :

i.e. sample output: System

cmd used : cat <file> | sed 's/.*File //' | sed 's/Closing.*$//'


Actually i have the same criteria but i want to do it from a variable which has special characters ..

For Example :

$VAR=USING (FILE '/TEST1/FILENAME'5000)

From the above string i want to reterive the value between ' and ) in this case its 5000.

Any Suggestions will be helpful

Thanks

Rahul
 
Code:
$VAR =~ /'(\d+)\)/);
$digits = $1;


------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top