in reply to regular expression across lines?
I have created a simple example below -$stmt =~ m/^FROM\s+(\S+)$/mgs;
And the output is as expected -use strict; use warnings; my $sql = q{ SELECT id FROM table WHERE name like 'A%' }; my ($table) = $sql =~ m/^FROM\s+(\S+)$/mgs; print "$table\n";
And of course if you want to capture multiple table names, with FROM on the same line, etc, the regular expression will be more complex, but that is out of scope.table
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: regular expression across lines?
by Anonymous Monk on Dec 03, 2003 at 00:02 UTC | |
by Roger (Parson) on Dec 03, 2003 at 00:22 UTC | |
by Anonymous Monk on Dec 03, 2003 at 00:14 UTC |