Solved

regexp for symol outlining in Codewright

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cpan issue 1 61
Perl Sort Question 4 129
PERL - Find newest folder 12 113
Perl - Passing cookies received with CGI::Cookie through to and from LWP::UserAgent->Post 5 72
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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

930 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

16 Experts available now in Live!

Get 1:1 Help Now