-1

トリプル (|||) と || をチェックする VBScript 正規表現の作成に助けが必要です。と | 例として出力を提供します:-

Contacts ||| ||Position: |PosH | |Pos Cust ||Name: |Name H | |Name Cust || 

a1:-Contacts,a2:||Position: |PosH | |Pos Cust ||Name: |Name H | |Name Cust || 
b1:-Position:, b2:-Name:
c1:PosH ,c2: ,c3:Pos Cust 
4

1 に答える 1

1

Split() を使用するだけです。

>> s = "Contacts ||| ||Position: |PosH | |Pos Cust ||Name: |Name H | |Name Cust ||"
>> a = Split(s, "|")
>> For i = 0 To UBound(a)
>>     WScript.Echo i, """" & a(i) & """"
>> Next
>>
0 "Contacts "
1 ""
2 ""
3 " "
4 ""
5 "Position: "
6 "PosH "
7 " "
8 "Pos Cust "
9 ""
10 "Name: "
11 "Name H "
12 " "
13 "Name Cust "
14 ""
15 ""
>> WScript.Echo "a1", """" & a(0) & """"
>> WScript.Echo "c3", """" & a(8) & """"
>>
a1 "Contacts "
c3 "Pos Cust "
>>

(そしていくつかの Trim() を投げます)

于 2013-10-23T18:28:29.203 に答える