can't compile the do shell script command

I am working a script to replace the contents of a text file. This line works great in Automator but AppleScript complains when I try to compile this line.

do shell script "perl -pi -w -e 's/log_location:(.*?)\<\/xmpDM:comment>/\<\/xmpDM:comment>/g;'" & inputFile

The error is: Expected “”" but found unknown token and the first < character is highlighted.

The need is to replace “log_location:UNKNOWNTEXT</xmpDM:comment>” with “</xmpDM:comment>”


Try this. :wink:

do shell script "perl -pi -w -e 's/log_location:(.*?)\\<\\/xmpDM:comment>/\\<\\/xmpDM:comment>/g;"

Thank you! That’s what I needed.