日期:2014-05-17  浏览次数:20778 次

用js 实现怎样从一个长字符串中截取特定的字符串
我想从下面的字符串中截取出 
@[{"id":"103101","text":"数据上传","attributes":{"functionid":"4028a8a04365b03e01436678e8540009","URL":null}},
{"id":"103102","text":"数据查看","attributes":{"functionid":"4028a8a04365b03e014366791950000a","URL":null}},
{"id":"103103","text":"数据下载","attributes":{"functionid":"4028a8a04365b03e014366794a98000b","URL":null}},
{"id":"103104","text":"数据删除","attributes":{"functionid":"4028a8a044b9026d0144b91d98d90006","URL":null}},
{"id":"103105","text":"导出软件工区","attributes":{"functionid":"4028a8a044b9026d0144b91ef5bf0007","URL":null}},
{"id":"103106","text":"数据备份","attributes":{"functionid":"4028a8a044b9026d0144b91f49600008","URL":null}}]
@[{"id":"103901","text":"GPTMap查询","attributes":{"functionid":"4028a8a044b993bc0144b9fc7baf000a","URL":null}}]
@[{"id":"107122","text":"附件上传事务控制例子","attributes":{"functionid":"40288aee3b40556d013b405a1f160002","URL":"../../jasframework/samples/fileuploadDemo/fileuploaddemo.html"}},
{"id":"107120","text":"员工信息管理-操作日志示例","attributes":{"functionid":"4028b2a53df30555013df307fbd40001","URL":"../../jasframework/samples/employee/queryEmployee.htm"}},
{"id":"107123","text":"导入Excel数据","attributes":{"functionid":"40288af93e0ba286013e0bb4ac7d0001","URL":"../../jasframework/components/dataimport/dataimportdemo.htm"}},
{"id":"107147","text":"报销流程","attributes":{"functionid":"48625gfgfgrreeeerrb-4ddsrfsfsfcdbb37e4","URL":"../../jasframework/samples/apply/applyDataGrid.htm"}},
{"id":"107125","text":"图表统计","attributes":{"functionid":"40288a333e34b69c013e34ba68740001","URL":"../../jasframework/landingCount/index.htm"}},
{"id":"107124","text":"综合示例","attributes":{"functionid":"40288aaf3ec0d173013ec0d2747d0001","URL":"../../jasframework/log/businessDataGrid.htm"}},
{"id":"107121","text":"请假管理","attributes":{"functionid":"b1368444-24af-4f2a-94bf-de60d5c62b8e","URL":"../../jasframework/samples/vacation/vacationDataGrid.htm"}}]
@[{"id":"103801","text":"GPTLog查询","attributes":{"functionid":"4028a8a044b993bc0144b9fc2e940009","URL":null}}]@[{"id":"101203","text":"配置助手","attribute…
------解决方案--------------------
str.match(/10[0-9]{4}/g)   直接返回你要的数组,亲测可行,楼主赏分!