使用正则表达式(正则表达式)拆分段落。

时间:2011-01-17 10:01:23

标签: c# regex

如何使用以下方法拆分段落

First Method =  {A-Z} <br>

Second Method =  {A-Z}<br>

Third Method =  {A-Z}.<br>

Fourth Method =  {A-Z}.\r\n

&GT;

注意:输入可能包含上述所有方法的组合。

请帮我找出正确的正则表达式,以便在段落下方进行拆分。

输入段落:

{A}<br> Circulation Research. 2000;87:540-542
<br><br>
For a more detailed discussion of the mechanisms underlying the relationship between nitric oxide and telomerase activation, see this study:<br>
Farsetti.  <aomerase tale in vascular aging Journal of Applied Physiology January 2009 vol. 106 no. 1 333-337
<br><br>
{B} <br>
Chauhan. =&_orig=search&_sort=d&view=c&_version=1&_urlVersion=0&_userid=10&md5=c130cff602472f25bd5680ea3047490c" target="_blank">"Aging-Associated Endothelial Dysfunction in Humans Is Reversed by L-Arginine"</a> Journal of the American College of Cardiology Volume 28, Issue 7, December 1996, Pages 1796-1804
<br><br>
{C}.<br>
Monajemi H target="_blank">Gene Expression in Atherogenesis"</a>.  <i>Thromb Haemost</i>. 2001 Jul;86(1):404-12.
<br>
{D}.
Britten M. The role of endothelial function of ischemic manifestations of coronary atherosclerosis
<br>
Kimura Y. Impaired endothelial function in hypertensive elderly patients evaluated by high..
<br><br>
{E}.<br>
9. In Cells, Aging and Human Disease, page 170, Michael Fossel writes:
<br>
In comparing young normal human aortic endothelial cells to senescent endothelial cells and endothelial cells imoortalized with hTERT, we find differences. Compared to young endothelial cells, senescent endothelial cells show a decreased production and activity of NO, changes critial in atherogenesis and hypertension. Similarly, senescent endothelial cells demonstrate increased monocyte adhesion, again implicated in atherogenesis. [..] In all cases, these differences are amerliorated or normalized by hTERT immortalization.
<br><br>
{F}.<br>
Chang E, Harley CB. Telomere length and replicative aging in human vascular tissues.

1 个答案:

答案 0 :(得分:1)

从你的例子中很难说,因为格式有点偏。似乎要涵盖的案例是:

  • 可选空格(换行符等)
  • {
  • 一封信A-Z
  • }
  • 一个可选的点
  • 空格(换行等)

如果这是真的,那么按

分割输入
\s*\{[A-Z]\}\.?\s*

应该有用。

在C#中:

splitArray = Regex.Split(subjectString, @"\s*\{[A-Z]\}\.?\s*");