-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathmb-regex-set-options.xml
231 lines (224 loc) · 6.96 KB
/
mb-regex-set-options.xml
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
222
223
224
225
226
227
228
229
230
231
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 1a025802f7201d353c1c1c4dccc7d9d6fdf563d4 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: takagi,mumumu -->
<refentry xml:id="function.mb-regex-set-options" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mb_regex_set_options</refname>
<refpurpose>マルチバイト正規表現関数のデフォルトオプションを取得または設定する</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mb_regex_set_options</methodname>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>options</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<simpara>
<parameter>options</parameter> で表されるオプションを、
マルチバイト対応の正規表現関数のデフォルトに設定します。
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
設定するオプション。文字列で設定し、各文字がオプションを表します。
モードを設定する際には、モード文字は最後に指定しなければなりません。
オプションは複数指定できますが、モードはひとつしか指定できません。
</para>
<table>
<title>Regex のオプション</title>
<tgroup cols="3">
<thead>
<row>
<entry>オプション</entry>
<entry>意味</entry>
<entry>&Changelog;</entry>
</row>
</thead>
<tbody>
<row>
<entry>i</entry>
<entry>曖昧なマッチをオンにする</entry>
<entry></entry>
</row>
<row>
<entry>x</entry>
<entry>拡張パターン形式を有効にする</entry>
<entry></entry>
</row>
<row>
<entry>m</entry>
<entry><literal>'.'</literal> が改行にマッチする</entry>
<entry></entry>
</row>
<row>
<entry>s</entry>
<entry><literal>'^'</literal> -> <literal>'\A'</literal>, <literal>'$'</literal> -> <literal>'\Z'</literal></entry>
<entry></entry>
</row>
<row>
<entry>p</entry>
<entry><literal>m</literal> と <literal>s</literal> を両方指定するのと同じ</entry>
<entry></entry>
</row>
<row>
<entry>l</entry>
<entry>最も長くマッチするものを探す</entry>
<entry></entry>
</row>
<row>
<entry>n</entry>
<entry>空のマッチを無視する</entry>
<entry></entry>
</row>
<row>
<entry>e</entry>
<entry>結果のコードを <function>eval</function> する</entry>
<entry>PHP 7.1.0 で非推奨になり、PHP 8.0.0 で削除されました。</entry>
</row>
</tbody>
</tgroup>
</table>
<note>
<para>
<function>mb_regex_set_options</function> に <literal>"e"</literal>
オプションを設定しても、何も起きません。
<function>mb_ereg_replace</function> や <function>mb_eregi_replace</function> で指定するようにしてください。
</para>
</note>
<table>
<title>Regex 構文モード(ひとつだけ設定可能です)</title>
<tgroup cols="2">
<thead>
<row>
<entry>モード</entry>
<entry>意味</entry>
</row>
</thead>
<tbody>
<row>
<entry>j</entry>
<entry>Java (Sun java.util.regex)</entry>
</row>
<row>
<entry>u</entry>
<entry>GNU regex</entry>
</row>
<row>
<entry>g</entry>
<entry>grep</entry>
</row>
<row>
<entry>c</entry>
<entry>Emacs</entry>
</row>
<row>
<entry>r</entry>
<entry>Ruby</entry>
</row>
<row>
<entry>z</entry>
<entry>Perl</entry>
</row>
<row>
<entry>b</entry>
<entry>POSIX Basic regex</entry>
</row>
<row>
<entry>d</entry>
<entry>POSIX Extended regex</entry>
</row>
</tbody>
</tgroup>
</table>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
以前設定されていたオプションを返します。
<parameter>options</parameter> が省略された場合、または &null; の場合、
現在設定されているオプションを文字列で返します。
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
<parameter>options</parameter> が指定され、&null; でない場合、
<emphasis>以前に</emphasis> 設定されていたオプションが返されるようになりました。
これより前のバージョンでは、
<emphasis>現在</emphasis> 設定されているオプションが返されていました。
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
<parameter>options</parameter> は、nullable になりました。
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
<literal>"e"</literal> オプションを指定すると、<classname>ValueError</classname> がスローされるようになりました。
</entry>
</row>
<row>
<entry>7.1.0</entry>
<entry>
<literal>"e"</literal> オプションを指定すると、<constant>E_DEPRECATED</constant> が発生するようになりました。
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mb_split</function></member>
<member><function>mb_ereg</function></member>
<member><function>mb_eregi</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->