【发布时间】:2014-08-05 05:25:50
【问题描述】:
我需要一个正则表达式来提取每个段落并存储为字符串,以便从包含许多类似段落的文本缓冲区中进行额外处理。
示例:比如说,文本缓冲区是这样的:
=== Jun 11 14:05:39 - Person Details ===
Person Name = "Hurlman"
Person Address = "2nd Street Benjamin Blvd NJ"
Persion Age = 25
=== Jun 11 14:05:39 - Person Details ===
Person Name = "Greg"
Person Address = "3rd Street Benjamin Blvd NJ"
Persion Age = 26
=== Jun 11 14:05:42 - Person Details ===
Person Name = "Michel"
Person Address = "4th Street Benjamin Blvd NJ"
Persion Age = 27
And I need to iterate through all the paragraphs and store each one of them to further find the specific person details inside.
Each paragraph I need to extract should be of the below format
=== Jun 11 14:05:42 - Person Details ===
Person Name = "Michel"
Person Address = "4th Street Benjamin Blvd NJ"
Persion Age = 27
非常感谢任何帮助!
【问题讨论】:
-
请提供您的银行详细信息,以便我们知道向您汇款的地点以便有机会编写此代码。
-
对不起,这是另一种说法:你能告诉我们你的尝试吗?
-
所以你想为每个段落创建一个新的(不同的)字符串?
-
是的,作为进一步处理的临时字符串。