Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
01-30-2012, 01:59 PM #1
- Join Date
- Jan 2012
- Thanked 0 Times in 0 Posts
String extraction from file using regular expression
I have a .c file with many function calls like, say, "ABC ( x, y, z);"
My concern is to extract just the function name ABC. My approach is to read the file using streamreader.ReadToEnd(), and find the function name using regular expression \b\w+(\([a-z]*[0-9]*\)\b\w).
the function call may be of the form...
ABC ( xab, ybc,
zbc, hgs );"
i.e. the syntax is spread thru multiple lines. in the end i just want the function name ABC.
please help me with the regular expression or if there is any other approach.