我想使用正则表达式从一个字符串中获取子字符串。需要注意的是:这些字符串值是邮件主题。
String1 = "Acceptance :DT_Ext_0062-12_012ed2 [Describe]"
string2 = "Acceptance : DT_Ext_0062-12_012 (ed.2) , Describe"
string3 = "Acceptance of : DT_Ext_0062-12_012 (ed.2) , Describe to me"
子字符串:
sub1 = Acceptance <Mail Type : like Reject or Accept>
sub2 = DT_Ext_0062-12_012 <ID : unique identifier>
sub3 = ed2 <Edition of mail, like : ed1, ed2, ed3 ...so on>
sub4 = Describe <Description of the mail>
我该如何编写正则表达式(可以分开写,也可以合并为一条)以获取以上两个字符串的输出结果。
我认为可以使用匹配组来检索数据。但我对正则表达式还很陌生。