I created these perl regular expressions and use them in the "Function List" as a group parsing rule for listing the function or procedure names in a oracle package:
They correctly list the names in the format I want, for example:
p procedure_name
f function_name
I would like to refine them to:
1. Skip the lines where it finds a match but the line is a comment, meaning the line has "--" anywhere before
the match on the same line.
2. Skip the lines where it finds a match but the match is in a 'comment block' meaning the match is NOT
between a "/*" and a "*/" where the "/*" could be on a line before the match and the "*/" could be
on a line after the match.
I believe #1 is possible without making it too slow, but #2 might make it too slow to be worth it...
I'm thinking #1 can be accomplished with a negative look behind but I haven't mastered the 'look-around' YET!!!
Any assistance/direction will be appreciated.
tia
Code: Select all
(f)unction( )+([a-zA-Z0-9,_]+$)
(p)rocedure( )+([a-zA-Z0-9,_]+$)
p procedure_name
f function_name
I would like to refine them to:
1. Skip the lines where it finds a match but the line is a comment, meaning the line has "--" anywhere before
the match on the same line.
2. Skip the lines where it finds a match but the match is in a 'comment block' meaning the match is NOT
between a "/*" and a "*/" where the "/*" could be on a line before the match and the "*/" could be
on a line after the match.
I believe #1 is possible without making it too slow, but #2 might make it too slow to be worth it...
I'm thinking #1 can be accomplished with a negative look behind but I haven't mastered the 'look-around' YET!!!
Any assistance/direction will be appreciated.
tia