/
532.txt
221 lines (164 loc) · 10.1 KB
/
532.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
[1] ある特定の形をした[[URI参照]]に一致するような[[パターン]]のようなものがいくつかの[[プロトコル]]で定義されています。
そのようなものを仮に[DFN[URI パターン]]と呼ぶことにします。
URI パターンはこれまで色々な規格で色々な方式が提案されてきましたが、
広く採用されているものはありません。むしろ、
単純な文字列として[[正規表現]]などを使って一致させる方法が広く使われています。
ただし、完全に文字列として扱う方法では、
[[百分率符号化]]だけの差異や[[ポート]]番号の有無など考慮しなければならないことが多すぎ、
厳密にしようとすると複雑でわかりにくくなってしまうという問題があります。
* URL
[30] [[URL]] 同士の[[比較]]演算や[[正規化]]によって[[一致]]するかどうかを判定する構文と方法については、
[[URLの比較]]を参照。
* URLpattern
[2] [[PICSRules]]
では [CODE(ABNF)[[[URLpattern]]]] という [[URI]] に似た文字列による表現を規定しています。
この文字列は URI と非常によく似ていますが、いくつかの部分で
[CODE(char)[[[*]]]] が使えるなど、本来の URI
とは異なる部分があります。
[CITE[PICSRules Specification]] <http://www.w3.org/TR/REC-PICSRules-971229#URLfilter>
* 拡張 URI
[4] '''P3P のワイルドカード入り[Q[拡張 URI]] ([Q[URI パターン]])''':
[[P3P]] は[[方針参照ファイル]]で [[URI]] [SRC[[[RFC 2396]]]]
の一致を記述するための
[Q[[[ワイルドカード]]]]が使える[Q[拡張 URI]] を規定しています。
- [[ワイルドカード]]として [CODE(char)[*]] が使えます。
任意の0文字以上を表します。
- [[URI]] に元から [CODE(URI)[*]] が含まれる場合は、
[[百分率符号化]]して [CODE(URI)[%2A]] に[[逃避]]する必要があります。
- [[UA]] は一致検査の際に[[ワイルドカード]]としての [CODE(char)[*]]
を認識してから、 [CODE(URI)[%2A]] を [CODE(URI)[*]]
に戻す必要があります。
- [[逃避]]とその逆変換は [[URI scheme]] 依存です。
- [[URI]] の構文に一致しない URI パターンは無視しても構いません。
とまあ、本来[[予約]]されていて[[百分率符号化]]の前後で等価性が保証されない
[CODE(URI)[*]] をワイルドカードに選んでしまったために、
[[URI scheme]] に独立な処理ができなくなってしまっています。
- [[P3P]] [CSECTION@en[2.3.2.1.2 Wildcards in policy reference files]]
<IW:P3P:"#ref_file_wildcards">
* 正規表現
[5]
[[WCAG 2.0]] の以前の [[WD]] では、 [[XML Schema]]
[[正規表現]]で表された [[URI]] の[[集合]]の記述を
[DFN[URI [RUBYB[パターン] @en[pattern]]]]と呼んでいました。
;; [CITE[Web Content Accessibility Guidelines 2.0]] <http://www.w3.org/TR/2005/WD-WCAG20-20050630/#URIpatterndef>
;; その後の [[WD]] では単に[Q[[[正規表現]]]]と呼んでいます。
[11]
[CITE[Rules-based Resource Property Sets in RDF]] ([CODE[2005-01-18 00:03:38 +09:00]] 版) <http://www.w3.org/2004/12/q/doc/rdf-rulesets.html>
[[Perl5]] [[正規表現]]を使用。
[13]
[[.htaccess]]: [[正規表現]]を使用可能。
* 前方一致
[3]
- [[XML型録]]の [CODE(XMLe)[[[uri]]]] 要素の
[CODE(XMLa)[[[name]]]] 属性は、
[[URI参照]]の単純な[[文字列]]としての[[前方一致]]を採用しています。
- 1999年版 [[RDF]] の [CODE(XMLa)[[[aboutEachPrefix]]]]
属性は [[URI参照]]の単純な文字列としての前方一致を採用しています。
-- [CITE[Resource Description Framework (RDF) Model and Syntax Specification]]
[CSECTION[3.4. Containers Defined By A URI Pattern]]
<http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/#URIPrefix>
[14] [CITE@en-US[Service Modeling Language Interchange Format Version 1.1]] ([TIME[2009-05-12 17:50:21 +09:00]] 版) <http://www.w3.org/TR/2009/REC-sml-if-20090512/#URI_prefix_matching>
* URI Templates
[29] [[RFC 6570]] は [[URI Templates]] なる [[URL]] を作成するための[[雛形]]言語を規定しています。
ただしこれは [[URL]] の生成のためのものなので、本項で扱っているような
[[URL]] との[[一致]]を検査するためのものではありません。
* メモ
[6]
[CITE@en-us[SML Interchange Format Version 1.0]] ([CODE[2007-03-08 05:32:26 +09:00]] 版) <http://www.w3.org/Submission/2007/SUBM-sml-if-20070321/#URI_prefix_matching>
([[名無しさん]])
[7]
[CITE@en[Protocol for Web Description Resources (POWDER): Web Description Resources Datatypes (WDRD)]] ([CODE[2007-09-27 06:24:18 +09:00]] 版) <http://www.w3.org/TR/2007/WD-powder-xsd-20070925/>
([[名無しさん]])
[8]
[CITE@en-US[Service Modeling Language Interchange Format Version 1.1]] ([CODE[2007-09-27 00:24:13 +09:00]] 版) <http://www.w3.org/TR/2007/WD-sml-if-20070926/#URI_prefix_matching>
([[名無しさん]])
[9]
[CITE@en[URISpace]] ([CODE[2001-02-16 04:12:14 +09:00]] 版) <http://www.w3.org/TR/2001/NOTE-urispace-20010215>
([[名無しさん]])
[10]
[CITE@en-US[URI Pattern Matching for Groups of Resources]] ([CODE[2006-06-21 03:51:25 +09:00]] 版) <http://www.w3.org/2005/Incubator/wcl/matching.html>
([[名無しさん]])
[12]
[[robots.txt]]: 当初は単純な完全一致または[[ディレクトリ]]部の一致のみだったが、後に拡張されている。
[15] [CITE@en[ESI Invalidation Protocol 1.0]]
( ([TIME[2001-08-03 20:31:31 +09:00]] 版))
<http://www.w3.org/TR/esi-invp>
[16] [CITE@EN[R2RML: RDB to RDF Mapping Language]]
( ([TIME[2012-09-27 00:23:35 +09:00]] 版))
<http://www.w3.org/TR/2012/REC-r2rml-20120927/#from-template>
[17] [CITE@en[RFC 6415 - Web Host Metadata]]
( ([TIME[2014-09-14 19:17:07 +09:00]] 版))
<http://tools.ietf.org/html/rfc6415#section-3.1.1.1>
[18] [CITE[Extensible Resource Descriptor (XRD) Version 1.0]]
( ([TIME[2010-11-01 20:25:40 +09:00]] 版))
<http://docs.oasis-open.org/xri/xrd/v1.0/xrd-1.0.html#link.attribute.template>
[19] [CITE@en[Website Parse Template]]
([TIME[2009-05-15 00:54:32 +09:00]] 版)
<http://www.w3.org/Submission/WPT/#urls_section>
[20] [CITE@en[Protocol for Web Description Resources (POWDER): Grouping of Resources]]
([TIME[2009-08-29 01:38:01 +09:00]] 版)
<http://www.w3.org/TR/2009/REC-powder-grouping-20090901/>
[21] [CITE@en[Protocol for Web Description Resources (POWDER): Formal Semantics]]
([TIME[2009-08-29 01:37:49 +09:00]] 版)
<http://www.w3.org/TR/2009/REC-powder-formal-20090901/#iriSets>
[22] [CITE[Content Scripts - Google Chrome Extensions - Google Code]]
( ([TIME[2011-07-04 23:20:05 +09:00]] 版))
<http://code.google.com/chrome/extensions/content_scripts.html>
[23] [CITE[Match Patterns - Google Chrome Extensions - Google Code]]
( ([TIME[2011-07-04 23:30:08 +09:00]] 版))
<http://code.google.com/chrome/extensions/match_patterns.html>
[24] [CITE@en[URL patterns - Custom Search Help]]
( ([TIME[2014-04-26 11:24:38 +09:00]] 版))
<https://support.google.com/customsearch/answer/71826?hl=en>
[25] [CITE[Resource Description Framework (RDF) Model and Syntax Specification]]
( ([TIME[1999-02-24 14:45:07 +09:00]] 版))
<http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/#URIPrefix>
[26] [CITE@ja[Google Developers Console Help — Google Developers]]
( ([TIME[2014-09-30 10:06:51 +09:00]] 版))
<https://developers.google.com/console/help/new/#whitelistingbyhost>
[27] [CITE[The Platform for Privacy Preferences 1.0 (P3P1.0) Specification]]
( ([TIME[2002-04-16 22:03:48 +09:00]] 版))
<http://www.w3.org/TR/P3P/#ref_file_wildcards>
[28] [CITE[The Platform for Privacy Preferences 1.0 (P3P1.0) Specification]]
( ([TIME[2002-04-16 22:03:48 +09:00]] 版))
<http://www.w3.org/TR/P3P/#hints>
[31] [[OAuth 2.0]] は、[[リダイレクトURL]]の登録方法の1つとして、
[[URL scheme]]、[[authority]]、[[path]] を指定する ([[query]] と[[素片識別子]]は含まない)
方法を規定しています。その場合、実際に指定された [[URL]] が登録されたものに一致するか[[比較]]することとなります。
[[RFC 3986]] を参照しつつも、具体的な[[比較]]の演算は定義していません。
;; [[リダイレクトエンドポイント]]を参照。
[FIG(quote)[
[FIGCAPTION[
[32] [CITE@en[mod_proxy - Apache HTTP Server Version 2.4]]
([TIME[2015-02-15 17:51:02 +09:00]] 版)
<http://httpd.apache.org/docs/current/en/mod/mod_proxy.html#Proxy>
]FIGCAPTION]
> Syntax: <Proxy wildcard-url> ...</Proxy>
> Directives placed in <Proxy> sections apply only to matching proxied content. Shell-style wildcards are allowed.
> <Proxy http://example.com/foo/*>
]FIG]
[FIG(quote)[
[FIGCAPTION[
[33] [CITE[Using the Proxy API - Opera 15+ extensions documentation]]
([TIME[2015-03-14 01:51:40 +09:00]] 版)
<https://dev.opera.com/extensions/tut_proxy.html>
]FIGCAPTION]
> This list may contain the following entries:
> '''['''<scheme>://''']'''<host-pattern>'''[''':<port>''']'''
> Match all hostnames that match the pattern <host-pattern>. A leading "." is interpreted as a "*.".
> Examples: "foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99", "https://x.*.y.com:99".
]FIG]
[FIG(quote)[
[FIGCAPTION[
[34] [CITE[Match patterns - Opera 15+ extensions documentation]]
([TIME[2015-03-14 01:51:40 +09:00]] 版)
<https://dev.opera.com/extensions/tut_match_patterns.html>
]FIGCAPTION]
> Match pattern syntax
> Here's the basic syntax:
> <url-pattern> := <scheme>://<host><path>
> <scheme> := '*' | 'http' | 'https' | 'file' | 'ftp' | 'chrome-extension'
> <host> := '*' | '*.' <any char except '/' and '*'>+
> <path> := '/' <any chars>
> The meaning of '*' depends on whether it's in the scheme, host, or path part. If the scheme is *, then it matches either http or https. If the host is just *, then it matches any host. If the host is *.hostname, then it matches the specified host or any of its subdomains. In the path section, each '*' matches 0 or more characters. The following table shows some valid patterns.
]FIG]