在每个数字后提取一个字符串

时间:2014-09-19 15:43:30

标签: .net regex

我必须提取一个字符串。该字符串由数字和文本组成。以下是示例

1. This is a test string that needs to be parsed based on numbers 2. This is a second test string that needs to be split based on numbers 3. This is the Third string that contains numbers like 1. 2., but this is also part of the string 4. This is the fourth string that has the mix of numbers and alphabets, this needs to be slit too <line Feed>

我需要在数字和文本之间分割这个字符串

所以

1 and This is a test string that needs to be parsed based on numbers 
2 and This is a second test string that needs to be split based on numbers 
3 and  This is the Third string that contains numbers like 1. 2., but this is also part of the string
4 and This is the fourth string that has the mix of numbers and alphabets, this needs to be slit too 

任何帮助将不胜感激

1 个答案:

答案 0 :(得分:0)

\s(?=\d+\.\s*This)

试试这个。可以找到任何其他匹配的模式。不得不使用This

参见演示。

http://regex101.com/r/pD5sV6/11

相关问题