回复 1# lxh623 - function getDic() {
- param(
- [string]$filename
- )
- $f1 = Get-Content -Encoding UTF8 ( $filename + ".xhtml" )
- $f2 = $f1 -join "`n"
- $f3 = $f2 -replace '(<span class="text_3">[^<>]+</span><span class="text_1">[(][^()]+[)]</span>)',"`n`$1`n" -split "`n"
- $f4 = $f3 -match "text_3"
- $f5 = $f4 -replace "<[^<>]+>",""
- $f5 | Out-File -Encoding utf8 ( $filename + ".txt" )
- }
-
- getDic ".\juans\F28n1071_005"
- getDic ".\juans\005"
复制代码 提取 text_3 text_1 里的字符
怎么替换 005 没明白 |