
strathglass
New User
Jul 15, 2009, 6:46 AM
Post #1 of 3
(1172 views)
|
|
Problem matching to pattern with variable
|
Can't Post
|
|
Trying to find lines like this in an input file to be processed:
#include <//Server//path//VYE//users.SYS//filename.inc> (so I can create a new output file with modified path info). Here is my test:
if ($line =~ m/^(#include[ \t]+<)$dxlSourcePath(.*)/i) where $dxlSourcePath is set to: "//Server//path//VYE//users.SYS" It is not working. What is confusing is the output from the following debug printout:
printf("NO MATCH to pattern /^(#include[ \\t]+<)$dxlSourcePath(.*)/i for line='$line'\n"); The output from above is:
NO MATCH to pattern /^(#include[ \t]+<)//Server//path//VYE//users.SYS///(.*)/i for line='#include <//Server//path//VYE//users.SYS//utils.inc>^M' Notice the three trailing slashes at the end of the printed $dxlSourcePath value, before the string '(.*)': where the heck did they come from?? Any help appreciated. Regards, Strathglass.
|