I have a problem with a pattern match, when a variable with special characters in the value from regex is used in the match.
The code:
in_pic_file = 'C:\\Users\\marcus.LAPTOP-01\\RAW\\2021\\20211031\\20211031-_R4_1301.tif'
sync_dir_in = 'C:\\Users\\marcus.LAPTOP-01\\RAW'
in_pic_file_strip = string.match( in_pic_file, ''..sync_dir_in..'(.+)\\' )
print ( in_pic_file_strip )
The result I want to have is \2021\20211031 but I always get a nil. When i suggest LAPTOP_01 instead aof LAPTOP-01 then j get the expected result. Obviously the - singn is interpreted as a regex command. But how can I suppress this?