Limited availability
Experimental: ããã¯å®é¨çãªæ©è½ã§ãã
æ¬çªã§ä½¿ç¨ããåã«ãã©ã¦ã¶ã¼äºææ§ä¸è¦§è¡¨ããã§ãã¯ãã¦ãã ããã
ã¡ã¢: ãã®æ©è½ã¯ã¦ã§ãã¯ã¼ã«ã¼å ã§å©ç¨å¯è½ã§ãã
exec()
㯠URLPattern
ã¤ã³ã¿ã¼ãã§ã¤ã¹ã®ã¡ã½ããã§ã URL ã¾ã㯠URL ã®é¨åãªãã¸ã§ã¯ããåãåããæå®ãããå
¥åãç¾å¨ã®ãã¿ã¼ã³ã¨ä¸è´ãããã©ããã示ãè«çå¤ãè¿ãã¾ãã
test(input)
test(input, baseURL)
弿°
input
ç
§åãã URL ã¾ã㯠URL ã®é¨åã§ããããã¯æååãã¾ãã¯åã
ã® URL ã®é¨åãè¨è¿°ãããªãã¸ã§ã¯ãã§ãã ãªãã¸ã§ã¯ãã®ã¡ã³ãã¼ã¯ãprotocol
ãusername
ãpassword
ãhostname
ãport
ãpathname
ãsearch
ãhash
ãbaseURL
ã®ããããã§ãããªãã¸ã§ã¯ãã§çç¥ããã¦ããé¨åã¯ã空æååã¨ãã¦æ±ããã¾ããå
¥åãè§£éã§ããªãå ´åãã¾ãã¯ãã¼ã¹ã®ãªãç¸å¯¾ URL ãæå®ãããå ´åããã®ã¡ã½ãã㯠null
ãè¿ãã¾ãã
baseURL
çç¥å¯
input
ãç¸å¯¾ URL ã®å ´åã«ä½¿ç¨ãããã¼ã¹ URL ã表ãæååã§ããæå®ããªãå ´åãæ¢å®ã§ã¯ undefined
ã«ãªãã¾ãããã®å¼æ°ãè§£éã§ããªãå ´åãã¡ã½ãã㯠false
ãè¿ãã¾ãã
è«çå¤ (boolean
) ã§ãã
ãã®ä¾ã§ã¯ test()
ã¡ã½ããã使ç¨ã㦠URL ããã¿ã¼ã³ã¨ç
§åããæ¹æ³ã示ãã¾ãããã®ä¾ã§ã¯ test()
ã®å¼ã³åºãã®çµæãã³ã³ã½ã¼ã«ã«åºåããã¾ãã
const pattern = new URLPattern("http{s}?://*.example.com/books/:id");
// 絶対 URL æåå
console.log(pattern.test("https://store.example.com/books/123")); // true
console.log(pattern.test("https://example.com/books/123")); // false
// ç¸å¯¾ URL æåå
console.log(pattern.test("/books/123", "http://store.example.com")); // true
console.log(pattern.test("/books/123", "data:text/plain,hello world!")); // false
console.log(pattern.test("/books/123")); // false
// æ§é åãªãã¸ã§ã¯ã
console.log(
pattern.test({
pathname: "/books/123",
baseURL: "http://store.example.com",
}),
); // true
console.log(
pattern.test({
protocol: "https",
hostname: "store.example.com",
pathname: "/books/123",
}),
); // true
console.log(
pattern.test({
protocol: "file",
hostname: "store.example.com",
pathname: "/books/123",
}),
); // false
仿§æ¸ ãã©ã¦ã¶ã¼ã®äºææ§ é¢é£æ
å ±
URLPattern
ã®ããªãã£ã«ã GitHub ã«ããã¾ããRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4