I have this batch script:
setlocal enableDelayedExpansion
set filename=%1%
set archive=%2%
set aleph=%3%
set bet=%4%
set gimel=%5%
if not x%filename:FEDBKA=%==x%filename% (
findstr /R <SHEM-HAKOVETZ>.*?(?:aa|tt|cc|bb|dd).*?<\/SHEM-HAKOVETZ> %1%
if !errorlevel! == 0 (
copy %filename% %archive%
move %filename% %gimel%
exit
)
findstr /R <SHEM-HAKOVETZ>.*?(?:rr|yy).*?<\/SHEM-HAKOVETZ> %1%
if !errorlevel! == 0 (
copy %filename% %archive%
move %filename% %aleph%
exit
)
findstr /R <SHEM-HAKOVETZ>.*?(?:ww|oo|pp).*?<\/SHEM-HAKOVETZ> %1%
if !errorlevel! == 0 (
copy %filename% %archive%
move %filename% %bet%
exit
)
exit
)
when I run the script, I get:
.*? was unexpected at this time.
Im looking for a xml tag pattern such as:
<SHEM-HAKOVETZ>104000514813450ttS000005201811221405351025.DAT</SHEM-HAKOVETZ>
where "tt" can be switched with the other options in the regex
If I replace the regex with simple findstr expression:
findstr "aa tt cc bb dd" %1%
everything works well, but it doesn't meet my exact demand.