我想獲取兩個字符之間的所有文本示例<div class="text-center"> <a href="/Users/Users/EditUser?UserId={userId}" [email protected] data-userRole="{userRole}"> <span class="fa fa-pencil fa-fw"></span> </a> <a href="/Users/Users/DeleteUser?UserId={userId}" onclick="return confirm('Are you sure you want to delete this?')" [email protected]> <span class="fa fa-trash-o fa-lg"></span> </a> </div>我有這個 html 變量,我需要括號“{}”之間的數組中的所有文本預期結果是:1.{用戶ID}2.{用戶角色}3.{用戶ID}在一個列表中。我嘗試過actualHtml.match(/\{(.*)\}/g)但結果是錯誤的,它采用第一個括號和最后一個括號,我得到的結果是 {userId}" [email protected] data-userRole="{userRole}
添加回答
舉報
0/150
提交
取消