Re: regexp q.
On Wed, Jul 16, 2008 at 09:45:03PM +0200, Florian Kulzer wrote:
...
>
> The insane approach (dedicated to Andrew S-W, who is a great perl
> aficionado):
>
> #! /usr/bin/perl -w
>
> #read file
> open ( FH, "test.txt" );
> $string = <FH>;
> close ( FH );
>
> # match and count
> while ( $string =~ /('(\\'|[^'\\])*'|(\\'|[^'\\)])*|\)[^,\\]|\),[^(])*\),\(/g ) { $count++ }
> print "$count\n"
>
gak my eyes bleed!
;-P
A
Reply to:
- References:
- regexp q.
- From: Hugo Vanwoerkom <hvw59601@care2.com>
- Re: regexp q.
- From: Florian Kulzer <florian.kulzer+debian@icfo.es>