Solved

regexp for symol outlining in Codewright

Posted on 2001-06-03
3
326 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now