用js 實現怎的從一個長字元串中截取特定的字元串

tags:    時間:2014-05-04 16:49:36
用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)   直接返回你要的數組,親測可行,樓主賞分!

推薦閱讀文章

Bookmark the permalink ,來源:互聯網