Skip to content

Commit 67f2f15

Browse files
Improve baseURL example
1 parent 9824a45 commit 67f2f15

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ print(result["pathname"]["groups"]["id"]) # output: 4163
6262
```py
6363
from urlpattern import URLPattern
6464

65-
pattern = URLPattern("/test", "https://example.com")
66-
print(pattern.test("/test", "https://example.com")) # output: True
67-
print(pattern.test({"pathname": "/test", "baseURL": "https://example.com"})) # output: True
65+
pattern = URLPattern("b", "https://example.com/a/")
66+
print(pattern.test("a/b", "https://example.com/")) # output: True
67+
print(pattern.test("b", "https://example.com/a/")) # output: True
68+
print(
69+
pattern.test({"pathname": "b", "baseURL": "https://example.com/a/"})
70+
) # output: True
6871
```
6972

7073
### `ignoreCase`

0 commit comments

Comments
 (0)