Reputation: 43
I am trying to remove tag head using regex of mutiples files recursive in windows 10 using perl
forfiles /s /m *.html /c "perl -pi -e s/<head(?:.|\n|\r)+?</head>//g @path"
but I get this message and I dont understand what I wrong
Illegal division by zero at -e line 1.
Upvotes: 0
Views: 160
Reputation: 19305
/
in </head>
must be escaped with \
because /
is the substitute delimiter or another delimiter can be used. for example s,<head(?:.|\n|\r)+?</head>,,g
.
also as regex seems to be multi line perl switch -0777
can be used to unset record separator and read the whole file, otherwise input is split bynewlines before applying regex.
Upvotes: 1