in reply to Extract data from regex match where "." is newline?
Prints:#!/usr/bin/perl use Modern::Perl; # 943829 my $str = "<Master ID='foobar\nblivitz' NameUI='12345'"; if ( $str =~ /<Master ID='(.*?)' NameUI='(.*?)'/sg ) { say "\$1: $1"; say "\$2: $2"; }else{ say "WTH?" }
So,$1: foobar blivitz $2: 12345
Please, post a sample, wraped in <code>...</code> tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extract data from regex match where "." is newline?
by dsayars (Initiate) on Dec 17, 2011 at 06:10 UTC |