Cheers, Can the regex expression below then be modified to find out if the number of slashes in the expression is greater than one?
-----Original Message----- From: Stovall, Adrian M. [mailto:[EMAIL PROTECTED]] Sent: 10 September 2002 15:16 To: perl-win32-users Subject: Regualr Expression You're missing a few slashes... $dir =~ s/\\/\//g; Or (more clearly) $dir =~ s|\\|/|g; To use a backslash in a matching expression and have it treated as a backslash (and not an escape sequence), you have to prefix it with another backslash. If a forward-slash is the delimiter for your expression, you have to prefix any forward slash in your expression with a backslash, too. It becomes a kind of hell... Your regex says s/\///g; or "replace every forward-slash with nothing at all (delete them)" -----Original Message----- From: Barlow, Neil [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 9:05 AM To: [EMAIL PROTECTED] Subject: Regualr Expression Hi all, I am dealing with directories and I read somewhere that it is best to use / rather than \ when dealing with directories. In order to cover my back - I am attempting to parse the string and replace any \ with / using the following: print "Please enter directory to search: "; # directory prompt chomp($dir = <STDIN>); $dir =~ s/\///g; But the regular expression is not replacing the slashes - can anyone assist on this I really appreciate your input Regards, Neil Barlow _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs