本帖最后由 cobat 于 2015-3-15 17:50 编辑
- @echo off
- call :label html head body script
- pause&exit
-
- :label
- for %%a in (%*) do (
- for /f "usebackq eol=# delims=" %%b in ("%~f0") do (
- set "ln=%%b"
- setlocal enabledelayedexpansion
- if /i "!ln: =!" equ "</%%a>" endlocal&set k=
- if defined k echo,!ln!
- if /i "!ln: =!" equ "<%%a>" (
- endlocal&set k=1
- ) else endlocal
- )
- )
- goto :eof
- <html>
- this is a "html" tag!
- `~!@#$%^&*()-=\_+|[]{};':",./<>?
- </html>
- <head>
- this is a "head" tag!
- </head>
- <body>
- this is a "body" tag!
- </body>
- <script>
- this is a "script" tag!
- </script>
复制代码
|