regexp for symol outlining in Codewright

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?
Who is Participating?
Kim RyanConnect With a Mentor IT ConsultantCommented:
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.
I believe that \s is well in order instead of [ \t]

the \n is not obligatory at the end

leighzionsAuthor Commented:
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.
All Courses

From novice to tech pro — start learning today.