in reply to Regex dynamics
#!/usr/bin/perl my $q; $q = qr/(?:\[(?:(?>[^\[\]]+)|(??{$q}))*\])/; while ( defined( $_ = <DATA> ) ) { while (/(\w{1,2})($q)/g) { print $1, $2, $/; #push(@{$hash{$1}},$2); } } __DATA__ T[[pP]attern] X[] X[xx[xxx[xx]]]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex dynamics
by Hena (Friar) on Feb 11, 2004 at 09:16 UTC | |
by borisz (Canon) on Feb 11, 2004 at 09:47 UTC | |
by Hena (Friar) on Feb 11, 2004 at 10:18 UTC | |
by borisz (Canon) on Feb 11, 2004 at 14:09 UTC | |
by Hena (Friar) on Feb 11, 2004 at 14:25 UTC |