Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

182.Text file parser -- How to extract all function names from a perl program?

User: editor -- 2008-06-09          << 181  183 >>
Hits: 3219
Type: Text file parser   
Search all Text file parser examples
Description:
How to extract all function names from a perl program?
Input Sample:
sub f1 { 
.... 

sub f2 { 
.... 

...
Output Sample:
f1 
f2 
...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. press control-o open the source file 
2. press control-h open 'Replace' dialog 
in 'Replace' page: 
* set 'Search for Pattern' to: 
 
* set 'Replace with Pattern' to: 
 
* uncheck '[ ]Print Unmatched units' option 
3. Click 'Replace', done! 
 
Notes:  
1. 'sub\s+\S+\s*\{' is regular expression, match "sub xxx {" 
2. uncheck '[ ]Print Unmatched units' option means do not generate output text except the matched one.
Download Script:  scripts/182.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to extract all function name and sub name from VBA script file? (67%)
How to extract all telephone numbers from a text file? (64%)
How to extract all links from a web page?   (62%)
How to extract half of lines from a text file randomly? (60%)
How to extract all html address from a text file? (60%)
How to extract all IP address from a text file? (59%)
How to extract all distinct parent folder names from a list of files? (57%)
How to extract all lines that contain words in a list? (56%)

Check Demo of Text file parser
Keywords:
control  except  perl  xxx  sub  names  function  unmatched  unmatch  regular expression  perl extract sub names  function names extract  perl text file parser  extract function parser  open source text file parser  text file parser open source  text parser open source  open source text parser