How about:
# Keeps newlines. my $str = q~ ... ~; my @fetch = grep { /test/ } ($str =~ m#(<IPDR>.*?</IPDR>)#sxgi); print(scalar(@fetch), "\n"); print join("\n---\n",@fetch);
or:
# Removes newlines. my $str = q~ ... ~; my @fetch = map { local $_=$_; s/\n+//g; $_ } grep { /test/ } ($str =~ m#(<IPDR>.*?</IPDR>)#sxgi); print(scalar(@fetch), "\n"); print join("\n---\n",@fetch);
In reply to Re: one line regexp problem
by ikegami
in thread one line regexp problem
by hoodlooms
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |