in reply to Regex Mystery
... # FAILS $file = 'C:\tmp'; $regex = qr~C:\\tmp~; if ($file =~ m/$regex/i) { print "\nTest with backslashes -- If stmt is true...\n"; }
Prints...
Test with forward slashes -- If stmt is true... Test with backslashes -- If stmt is true...
FYI coding while tired is a recipe for adding errors to code that you will find hard to find later.
Celebrate Intellectual Diversity
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Regex Mystery
by choroba (Cardinal) on Apr 13, 2025 at 17:54 UTC | |
by LanX (Saint) on Apr 13, 2025 at 19:15 UTC | |
by roho (Bishop) on Apr 14, 2025 at 04:54 UTC | |
by cavac (Prior) on Apr 18, 2025 at 13:39 UTC | |
Re^2: Regex Mystery
by roho (Bishop) on Apr 13, 2025 at 17:14 UTC | |
by cavac (Prior) on Apr 16, 2025 at 11:04 UTC |