Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to use "--include-regex" parameter with Az Copy to only sync files whose path name matches a pattern.
I did a Lab set up of your scenario and after playing around with the regular expressions for a while, I arrived at the below solution.
- Your file name/path is 2023-12-18/ABCD/abcdef1ab23.xml
- **Not /**2023-12-18/ABCD/abcdef1ab23.xml (i.e., no / at the start)
So, the pattern becomes
".*\/ABCD\/.*.xml"
i.e. no need to match the leading "/"
Kindly let us know if this helps or you need further assistance on this issue.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.