We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
匹配^http(?:s?)://www\.google\.com/url\?q=.*
^http(?:s?)://www\.google\.com/url\?q=.*
const regex = /url\?q=(https?:\/\/.*?)&.*/; const match = val.match(regex); if (match) { const capturedURL = match[1]; return decodeURIComponent(capturedURL); }
函数是这样。
{ "request": [ { "enable": true, "name": "去除Google重定向", "ruleType": "redirect", "matchType": "regexp", "pattern": "^http(?:s?)://www\\.google\\.com/url\\?q=.*", "exclude": "", "group": "未分组", "isFunction": true, "action": "redirect", "to": "https://gstatic.loli.net/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxK.woff2", "code": "const regex = /url\\?q=(https?:\\/\\/.*?)&.*/;\nconst match = val.match(regex);\nif (match) {\n const capturedURL = match[1];\n console.log(\"Captured URL:\", capturedURL); // 添加控制台打印\n return decodeURIComponent(capturedURL);\n}" } ], "sendHeader": [], "receiveHeader": [], "receiveBody": [] }
The text was updated successfully, but these errors were encountered:
{ "request": [ { "enable": true, "name": "去除Google重定向", "ruleType": "redirect", "matchType": "regexp", "pattern": "^http(?:s?)://www\\.google\\.com/url\\?q=.*", "exclude": "", "group": "CingList-Redirect", "isFunction": true, "action": "redirect", "to": "https://gstatic.loli.net/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxK.woff2", "code": "function extractURL(url) {\n const regex = /url\\?q=(https?:\\/\\/.*?)&/;\n const decodedVal = decodeURIComponent(url);\n const match = decodedVal.match(regex);\n return match ? match[1] : null;\n}\n\nreturn extractURL(val);" } ], "sendHeader": [], "receiveHeader": [], "receiveBody": [] }
这才是正确写法。
Sorry, something went wrong.
No branches or pull requests
匹配
^http(?:s?)://www\.google\.com/url\?q=.*
函数是这样。
The text was updated successfully, but these errors were encountered: