2012-12-20 27 views
0

我定字符串的單行這樣的VBScript正則表達式拆分郵件

To: =?ks_c_5601-1987?B?vcW5zsHY?= <[email protected]>, 
    =?ks_c_5601-1987?B?wNO9w8ij?= <[email protected]>, Henry Han 
    <[email protected]> 

基本上,他們是一組在某個字符集編碼的電子郵件地址。

我想他們分手了,並有一個僅僅包含電子郵件地址的數組

EX:

toAddress(0) = [email protected] 
toAddress(1) = [email protected] 
toAddress(2) = [email protected] 

是VBScript的正則表達式功能靈活,足以讓我需要什麼上面?我會很感激任何指導,謝謝。

回答

2
dim regex:set regex=new RegExp 
regex.Global=True 
regex.IgnoreCase=True 
regex.Pattern="<.*?>" 
dim ori:ori="To: =?ks_c_5601-1987?B?vcW5zsHY?= <[email protected]>," & vbLF &_ 
    "=?ks_c_5601-1987?B?wNO9w8ij?= <[email protected]>, Henry Han " & vbLF &_ 
    "<[email protected]>" 
Response.Write ori & vbLF 'just for debug 
dim matches:set matches=regex.Execute(ori) 
For Each match In matches 
    Response.Write match.value & vbLF 
Next 

與IIS 5測試,輸出:

<[email protected]> 
<[email protected]> 
<[email protected]> 

您可以刪除<>獲取時match.Value