vladb has asked for the wisdom of the Perl Monks concerning the following question:
My first (shameful) attempt was this pattern: m/([`'"])*[^\1]*;[^\1]*\1;/. However, it didn't work (for some obvious reasons ;).myfunc $x eq "foo;text";foobar';';$x++; # matching first Perl statement.. # should return: # myfunc $x eq "foo;text"; # # not: # myfunc $x eq "foo;";foobar'; # # or something else...
| "There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching first Perl statement.
by danger (Priest) on Jan 15, 2002 at 03:01 UTC | |
|
Re: Matching first Perl statement.
by Beatnik (Parson) on Jan 15, 2002 at 02:45 UTC | |
|
Re: Matching first Perl statement.
by talexb (Chancellor) on Jan 15, 2002 at 01:42 UTC | |
by $code or die (Deacon) on Jan 15, 2002 at 03:49 UTC | |
|
Re: Matching first Perl statement.
by Juerd (Abbot) on Jan 15, 2002 at 17:30 UTC | |
|
Re: Matching first Perl statement.
by Albannach (Monsignor) on Jan 15, 2002 at 19:37 UTC | |
|
Re: Matching first Perl statement.
by rdfield (Priest) on Jan 16, 2002 at 20:53 UTC |