内容例子:
哥伦比亚著名作家加西亚·马尔克斯的长篇小说《百年孤独》发表
内容组成:由n组 AAAABBBBBBCCCCC形式的内容组成的字符串
例如:
AAAA<a>BBBBBB</a>CCCCC
AAAA<a>BBBBBB</a>CCCCCAAAA<a>BBBBBB</a>CCCCC
AAAA<a>BBBBBB</a>CCCCCAAAA<a>BBBBBB</a>CCCCCAAAA<a>BBBBBB</a>CCCCC
最终取得的内容:
AAAABBBBBCCCCC
AAAAAAABBBBBBBCCCCCCAAAABBBBBCCCC
这样子;
这个正则在java里怎么写? 多谢;
最好一个正则不分组直接获取最终内容.
How is the text content determined? At present, it seems that all you need to do is delete the
<a>
和</a>
tag. This is not difficult, right?[Supplement]If it’s just text + a tag, just use as the basic regular expression.
</?a>
But I am not very familiar with Java. The code generated online is as follows. It seems that it only matches but does not replace. I hope you can change it. . .