Skip to content

Commit a0b43b0

Browse files
committed
Update README.md
1 parent 6ade139 commit a0b43b0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The URL Pattern Standard is a web standard for URL pattern matching. It is usefu
1313

1414
It's a thin wrapper of [denoland/rust-urlpattern](https://github.com/denoland/rust-urlpattern) with [PyO3](https://github.com/PyO3/pyo3) + [Maturin](https://github.com/PyO3/maturin).
1515

16+
The naming conventions follow [the standard](https://urlpattern.spec.whatwg.org/) as closely as possible, similar to [xml.dom](https://docs.python.org/3/library/xml.dom.html).
17+
1618
## Installation
1719

1820
On Linux/UNIX or macOS:
@@ -55,6 +57,16 @@ result = pattern.exec({"pathname": "/users/4163/"})
5557
print(result["pathname"]["groups"]["id"]) # output: 4163
5658
```
5759

60+
### `baseURL`
61+
62+
```py
63+
from urlpattern import URLPattern
64+
65+
pattern = URLPattern({"pathname": "/admin/*"}, "https://example.com")
66+
print(pattern.test({"pathname": "/admin/main/"}, "https://example.com")) # output: True
67+
print(pattern.test("/admin/main/", "https://example.com")) # output: True
68+
```
69+
5870
### `ignoreCase`
5971

6072
```py
@@ -69,7 +81,7 @@ print(pattern.test("https://example.com/test")) # output: True
6981
print(pattern.test("https://example.com/TeST")) # output: True
7082
```
7183

72-
### Simple WSGI app
84+
### A simple WSGI app
7385

7486
```py
7587
from wsgiref.simple_server import make_server

0 commit comments

Comments
 (0)