Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

regexp for symol outlining in Codewright

Posted on 2001-06-03
3
331 Views
Last Modified: 2012-05-04
I use an editor called Codewright to do my Perl programming in. It has a symbol ouliner that creates a list of all your subrotuines/functions for easy navigation. These are defined for languages like C and Basic, using it's own form of regexps. For Pascal procedures it's:

^[ \t]*procedure[ \t]+[a-zA-Z0-9_]+((\.[a-zA-Z0-9_]+\c[^a-zA-Z0-9_])|(\c[^\.a-zA-Z0-9_])).*[\n]

What would be needed to outline perl functions?
0
Comment
Question by:leighzions
3 Comments
 
LVL 19

Accepted Solution

by:
Kim Ryan earned 300 total points
ID: 6151326
I assume you mean subrountines (sub) rather than functions.
^[ \t]*sub[ \t]+\c[a-zA-Z0-9_]+.*[\n]
If all your subroutines start a t the first column, you can remove the [ \t]* at the start.
0
 
LVL 8

Expert Comment

by:shlomoy
ID: 6151376
I believe that \s is well in order instead of [ \t]

the \n is not obligatory at the end

0
 

Author Comment

by:leighzions
ID: 6151432
Thanks teraplane, that worked. Sholomy, Codewright has it's own regexp syntax which is slightly differnet from Perl, there is no \s, only space and \t.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question