From: W.J.M. N. <Wim...@nl...> - 2011-04-15 06:11:43
|
Hello, > I am attempting to use the SUBSTR transform but it does not seem to > allow a negative position. I am trying to grab the text at the end of a > string. The application does not seem to like this. Or am I using it > wrong? > Devmon does not check for a negative value of the offset. You might try the following patch, which is I did NOT test: Index: dm_templates.pm =================================================================== --- dm_templates.pm (revision 14) +++ dm_templates.pm (working copy) @@ -567,7 +567,7 @@ }; $func_type eq 'substr' and do { - $temp =~ s/\s*\{\s*\S+?\s*\}\s+(\d+)\s*(\d*)\s*//; + $temp =~ s/\s*\{\s*\S+?\s*\}\s+(-?\d+)\s*(\d*)\s*//; do_log("SUBSTR transform uses only a single oid, a numeric offset " . "and an optional shift value at $trans_file, line $l_num", 0) and next LINE if $temp ne ''; Index: dm_tests.pm =================================================================== --- dm_tests.pm (revision 15) +++ dm_tests.pm (working copy) @@ -533,7 +533,7 @@ my $oid_h = \%{$oids->{$oid}}; my ($dep_oid, $offset, $length) = ($1, $2, $3) - if $oid_h->{'trans_data'} =~ /\{(.+)\}\s+(\d+)\s*(\d*)/; + if $oid_h->{'trans_data'} =~ /\{(.+)\}\s+(-?\d+)\s*(\d*)/; my $dep_oid_h = \%{$oids->{$dep_oid}}; $length = undef if $length eq ''; Kind regards, Wim Nelis. ******************************************************************************************************* The NLR disclaimer (http://www.nlr.nl/emaildisclaimer) is valid for NLR e-mail messages. ******************************************************************************************************* |