什麼是正規表達式模式,以實現以下任務如何使用正則表達式解析數據
數據格式(模式)
anyword:anycharcters;
樣品輸入
msg:"c# 6.0 is good";sid:201;classtype:object oriented;.net,ado.net,other messages
預期輸出(匹配組)
msg:"c# 6.0 is good"; ----------> 1
sid:201;--------------------->2
classtype:object oriented;---------->3
[String.split](HTTPS://msdn.microsoft.com/en-us/library/system.string.split \(V = vs.110 \ ).aspx)可能比鑽研正則表達式更容易。 –