本帖最后由 xiehuahere 于 2012-8-24 10:15 编辑
回复 1# Qokelate
将你给出的文本写入file.txt测试。
Local Const $oFile = ".\file.txt"
Local $aRecords, $str, $result
If Not FileExists($oFile) Then Exit MsgBox(48 + 262144, "Warning", 'File "' & $oFile & '" does not exit!')
$str = FileRead($oFile)
If Not StringInStr($str, "start==>") Then Exit
If StringInStr($str, "<==End") Then
$result = StringRegExpReplace($str, '(?is).*?start==>(.*?)<==End.*', '$1', 1)
Else
$result = StringRegExpReplace($str, '(?is).*?start==>(.*)\z', '$1', 1)
EndIf
MsgBox(0, "", $result)
|