The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-22-2008
wolwy_pete wolwy_pete is offline
Registered User
 

Join Date: Mar 2008
Posts: 11
perl newbie: how to extract an unknown word from a string

hi,
im quite new to perl regexp. i have a problem where i want to extract a word from a given string. but the word is unknown, only fact is that it appears as the second word in the string.

Eg.
input string(s) :
char var1 = 'A';
int var2 = 10;
char *ptr;

and what i want to do is to get the variable name (var1, var2, ptr ..etc.) from an above like string.
can we use something like (w+) to match a whole word.

thankx in advance.
wolwy.
Reply With Quote
Remove advertisements
!!
Forum Sponsor