javascript – 选择两个单词之间的文字

我正在从维基词典中检索一些数据.它们的API解析整个文本块,没有html属性或xml属性.

文本的一个例子:

===Etymology===
{{-er|develop}}

===Pronunciation===
* {{a|UK}} {{IPA|/dɪˈvɛləpə(ɹ)/}}
* {{a|US}} {{IPA|/dɪˈvɛləpɚ/}}

===Noun===
{{en-noun}}

# A person or entity engaged in the [[creation]] or [[improvement]] of certain classes of products.
# A [[real estate]] developer; a person or company who prepares a parcel of land for sale, or creates structures on that land.
# A [[film]] developer; a person who uses [[chemical]]s to create [[photograph]]s from photograph negatives.
# A [[liquid]] used in the chemical processing of traditional photos.
# A [[software]] developer; a person or company who creates or modifies [[computer]] software.

====Synonyms====
* {{sense|person or company who writes computer software}} [[programmer]]

====Related terms====
* [[develop]]
* [[development]]
* [[developmental]]

是否可以选择=== Noun ===和====同义词====之间的文本?
例如,我想最终得到这个:

>从事创建或改进某类产品的个人或实体.
>房地产开发商;准备一块待售土地或在该土地上建造建筑物的人或公司.
>电影开发者;使用[[化学]]从照片底片创建[[照片]]的人.
>用于传统照片化学处理的液体.

======================

整个文本块可以在这里找到:http://pastebin.com/raw.php?i=5ETx4ivB,API的结果可以在XML格式中找到:http://en.wiktionary.org/w/api.php?action=query&prop=revisions&rvprop=content&format=xml&titles=developer

最佳答案 你能试一下吗

var start  = str.indexOf('===Noun==='), end = str.indexOf('====Synonyms====');
var text = str.substring(start + 11, end) // +11 since `indexof` gives the start index and you need to exclude `===Noun===`
点赞