#!/usr/bin/perl
use strict;
use warnings;
my $index = 0;
my @nsi = (q~<nContractID>13523</nContractID>~);
my %xmlstring = (
QueryCId => qr/<nC[o]?ntr[a]?ctID[^>]*>\s*(\d+)\s*<\/nC[o]?ntr[a]?ctID>/s,
);
print "\n1 reg: ", $nsi[$index] =~ /$xmlstring{'QueryCId'}/;
$nsi[$index] =~ /$xmlstring{'QueryCId'}/ ?
print "\nMATCH" :
print "\nNO MATCH";
my $cid = $nsi[$index] =~ /$xmlstring{'QueryCId'}/ ? '' : 'I HATE YOU';
print "\nCID should be empty: ", $cid;