字符串
#356823032172848##0#0000#AUT#2#45262726#12641.0418,E,4544.3078,N,002.76,278#180411#033704##
#356823032172848##0#0000#AUT#2#V#12641.1862,E,1.1861,E,4544.3011,N,000.23,62#190411#015217##规则: 起始字符为 #+15位数字+## 结束字符为##
#356823032172848##0#0000#AUT#2#45262726#12641.0418,E,4544.3078,N,002.76,278#180411#033704##
#356823032172848##0#0000#AUT#2#V#12641.1862,E,1.1861,E,4544.3011,N,000.23,62#190411#015217##规则: 起始字符为 #+15位数字+## 结束字符为##
如下例
#356823032172848##0#0000#AUT#2#45262726#12641.0418,E,4544.3078,N,002.76,278#180411#033704##注意红色的部分
string str = @"aaaaa
#356823032172848##0#0000#AUT#2#45262726#12641.0418,E,4544.3078,N,002.76,278#180411#033704##
#356823032172848##0#0000#AUT#2#V#12641.1862,E,1.1861,E,4544.3011,N,000.23,62#190411#015217##
bbb";
Regex reg = new Regex(@"(?<=#)\d{15}##((?!##).)*(?=##)");
foreach (Match m in reg.Matches(str))
{
Response.Write(m.Value + "<br/>");
}
/*
356823032172848##0#0000#AUT#2#45262726#12641.0418,E,4544.3078,N,002.76,278#180411#033704
356823032172848##0#0000#AUT#2#V#12641.1862,E,1.1861,E,4544.3011,N,000.23,62#190411#015217
*/