/.*/
Regex 測試工具
對文字測試正規表達式,並即時醒目提示符合結果。
測試文字
輸入模式與測試文字,或載入範例以開始使用。
輸入模式與測試文字,或載入範例以開始使用。
相符數量:0
在上方輸入正則表達式以檢視其解析出的語彙單元樹狀結構。
使用多個預期相符與不相符的案例來驗證目前模式。
const regex = /.+/g;
const text = "sample text";
const matches = Array.from(text.matchAll(regex));
for (const match of matches) {
console.log('Match:', match[0], 'at', match.index, match.groups ?? {});
}