Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

regexp for symol outlining in Codewright

Posted on 2001-06-03
3
Medium Priority
?
348 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 1200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
Six Sigma Control Plans

772 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