正则表达式 - 重复数据

use*_*479 1 javascript regex

我有一个数据:

#object
id=91
name=precka
material=18ST2
#topology
2, 1, 5, 4, 9, 8, -1
#points
566.068643742472, 135, 9

#object
id=92
name=precka2
material=18ST2
#topology
6, 1, 6, 4, 9, 8, -1  
5, 1, 6, 4, 9, 8, -1
#points
216.068643742472, 235, 19 
216.068643742472, 235, 19
Run Code Online (Sandbox Code Playgroud)

现在我需要从id,name,material,#topology到#points获取所有内容.目前我设法写了一个如下所示的正则表达式:

/#topology+([\s\S]*)#points([\s\S]+)/m
Run Code Online (Sandbox Code Playgroud)

我想将其更改为从#object循环到#object并获取每个#object数据(id,name,topoloy ..).这很难吗?

dee*_*see 5

String.split您的文本#object并将您的正则表达式应用于函数返回的数组中的每个元素.