in reply to Scanning a plsql package body to make package headers... regexp requested
The m is important to enable multi-line matching, or your regex will not scan across newlines.#!/usr/bin/perl -w use strict; my $file = shift or die "must supply body file"; open F, $file; my $text = join '', <F>; my $regex = '(procedure|function)\b(.*?)\((.*?)\)'; while ($text =~ /$regex/mgs) { print $1,$2,"($3);",$/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Scanning a plsql package body to make package headers... regexp requested
by princepawn (Parson) on Mar 28, 2001 at 03:26 UTC |