使用正则表达式我必须拆分字符串模式并展开它们。
例如:
String Pattern = "rue Richard2" -----> in 2 string
Substring1 = "rue Richard" , Substring2 = "2"
但是对于像“rue-Richard 2-5”这样更复杂的字符串模式,我必须拆分和扩展:
Substring1 = "rue-Richard " , Substring2 = "2"
Substring1 = "rue-Richard " , Substring2 = "3"
Substring1 = "rue-Richard " , Substring2 = "4"
Substring1 = "rue-Richard " , Substring2 = "5"
但对于另一个更复杂的字符串模式,如“rue-Richard 2,5,7,11”,我必须拆分和展开:
Substring1 = "rue-Richard." , Substring2 = "2"
Substring1 = "rue-Richard." , Substring2 = "5"
Substring1 = "rue-Richard." , Substring2 = "7"
Substring1 = "rue-Richard." , Substring2 = "11"