本帖最后由 gzh888666 于 2011-11-12 15:21 编辑 Local $Str = _
'C:\CreateFile\atu\mcc\gpi_1.ch' & @CRLF & _
'C:\CreateFile\input\mcc1\gpio_matrix.ch' & @CRLF & _
'C:\CreateFile\star\1154\sta0\gpio_output.ch' & @CRLF & _
'C:\CreateFile\input\mcc3\xts\estr\gpio_switch.ch' & @CRLF & _
'C:\CreateFile\input\mcc4\sta1\keychord.ch' & @CRLF & _
'C:\CreateFile\input\mcc5\est\etc\lighr_smd.ch' & @CRLF & _
'C:\CreateFile\input\mcc6\uinput.ch' & @CRLF & _
'C:\CreateFile\imoter\screen\cat.ch' & @CRLF & _
'C:\CreateFile\imoter\screen1\eas_22a4e.ch' & @CRLF & _
'C:\CreateFile\input\m101\lighr_smd.ch' & @CRLF & _
'C:\CreateFile\input\mcc\uinput.ch' & @CRLF & _
'C:\CreateFile\input\screen\cat.ch' & @CRLF & _
'C:\CreateFile\input\screen1\eas_22a4e.ch' & @CRLF
MsgBox(0, '原字符串', $Str)
Local $Test = StringRegExp($str, '(?i):\\.+?\\(.*)\\.+?\.ch', 3)
For $i=0 To UBound($Test)-1
If Not @Error Then MsgBox(0, '匹配UBound数量: ' & UBound($Test), '其中['&$i&']元素为: ' & $Test[$i])
Next
|