Hi All,We have upgraded our TS from 6.5 SP3 to 6.7.1.0 on Win 2000 Platform. Now we are facing this weird error of regex not working properly.my $path = $outPage;print $fhandle1 "\n\n pathbefore $path \n\n";$path =~ s#.*\\(htdocs\\.*\\).*\.xml$#$1#;print $fhandle1 "\n\npathbetn $path \n\n";$path =~ s#\\#\/#g; print $fhandle1 "\n\npathafter $path \n\n";In the above code the outPage path is in the following formatY:\default\main\bt_global\intranet\main\content\global\products\root\WORKAREA\maintenance\htdocs\9731_test2\xyzafter applying the regex we get htdocs\9731_test2\ This only works ifor the new form generation . But when we try to regenrate the DCR the regex is not working. Alothough the 2nd regex ($path =~ s#\\#\/#g; ) works fine for new form and the old DCR too. We are not able to figure out why is this happening.Can anyone please help.
(my $path = $outPage) =~ tr|\\|/|;print $fhandle1 "\n\n pathbefore $path \n\n";$path =~ s|^.*/(htdocs/.*/).*\.xml$|$1|;print $fhandle1 "\n\npathafter $path \n\n";
pathbefore Y:/default/main/bt_global/intranet/main/content/global/products/root/WORKAREA/maintenance/htdocs/9731_test2/xyzpathafter Y:/default/main/bt_global/intranet/main/content/global/products/root/WORKAREA/maintenance/htdocs/9731_test2/xyz
$path =~ s|^.*/(htdocs/.*/).*$|$1|;
$path =~ s|^.*/(htdocs/.*?/).*$|$1|;
$path =~ s|^.*/(htdocs/.*/).*$|$1|; As was posted earlier, though I would make the captured .* in the regex above a non-greedy match. $path =~ s|^.*/(htdocs/.*?/).*$|$1|; This will insure you only get the directory immediately following the "htdocs" rather than all directories below it, unless of course, that is what you are trying to do.
Thanks for your support guys.What i have found is that there is no .xml extension (rightly pointed out by ghoti). Now this .xml is not coming in tha path only when i generate the old DCR. With the new DCR it has .xml attached to it. So even if i try fixing the regex i get 2 DCR's generated in the same area (i.e for eg the original DCR has work.xml and after editing & generating it become work).Now i am trying to figure out why .xml is not getting appended in the path.