reference/mbstring/functions/mb-regex-set-options.xml
1a025802f7201d353c1c1c4dccc7d9d6fdf563d4
...
...
@@ -10,7 +10,7 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>string</type><methodname>mb_regex_set_options</methodname>
13
-
<methodparam choice="opt"><type>string</type><parameter>options</parameter><initializer>mb_regex_set_options()</initializer></methodparam>
13
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>options</parameter><initializer>&null;</initializer></methodparam>
14
14
</methodsynopsis>
15
15
<simpara>
16
16
Sets the default options described by <parameter>options</parameter>
...
...
@@ -34,52 +34,67 @@
34
34

35
35
<table>
36
36
<title>Regex options</title>
37
-
<tgroup cols="4">
37
+
<tgroup cols="3">
38
38
<thead>
39
39
<row>
40
40
<entry>Option</entry>
41
41
<entry>Meaning</entry>
42
+
<entry>&Changelog;</entry>
42
43
</row>
43
44
</thead>
44
45
<tbody>
45
46
<row>
46
47
<entry>i</entry>
47
48
<entry>Ambiguity match on</entry>
49
+
<entry></entry>
48
50
</row>
49
51
<row>
50
52
<entry>x</entry>
51
53
<entry>Enables extended pattern form</entry>
54
+
<entry></entry>
52
55
</row>
53
56
<row>
54
57
<entry>m</entry>
55
58
<entry><literal>'.'</literal> matches with newlines</entry>
59
+
<entry></entry>
56
60
</row>
57
61
<row>
58
62
<entry>s</entry>
59
63
<entry><literal>'^'</literal> -> <literal>'\A'</literal>, <literal>'$'</literal> -> <literal>'\Z'</literal></entry>
64
+
<entry></entry>
60
65
</row>
61
66
<row>
62
67
<entry>p</entry>
63
68
<entry>Same as both the <literal>m</literal> and <literal>s</literal> options</entry>
69
+
<entry></entry>
64
70
</row>
65
71
<row>
66
72
<entry>l</entry>
67
73
<entry>Finds longest matches</entry>
74
+
<entry></entry>
68
75
</row>
69
76
<row>
70
77
<entry>n</entry>
71
78
<entry>Ignores empty matches</entry>
79
+
<entry></entry>
72
80
</row>
73
81
<row>
74
82
<entry>e</entry>
75
83
<entry><function>eval</function> resulting code</entry>
84
+
<entry>Deprecated as of PHP 7.1.0 and removed as of PHP 8.0.0</entry>
76
85
</row>
77
86
</tbody>
78
87
</tgroup>
79
88
</table>
89
+
<note>
90
+
<para>
91
+
The <literal>"e"</literal> option has no effect when set through <function>mb_regex_set_options</function>.
92
+
Use it with <function>mb_ereg_replace</function> or <function>mb_eregi_replace</function>.
93
+
</para>
94
+
</note>
80
95
<table>
81
-
<title>Regex syntax modes</title>
82
-
<tgroup cols="4">
96
+
<title>Regex syntax modes (only one may be set)</title>
97
+
<tgroup cols="2">
83
98
<thead>
84
99
<row>
85
100
<entry>Mode</entry>
...
...
@@ -131,11 +146,52 @@
131
146
<refsect1 role="returnvalues">
132
147
&reftitle.returnvalues;
133
148
<para>
134
-
The previous options. If <parameter>options</parameter> is omitted,
149
+
The previous options. If <parameter>options</parameter> is omitted or &null;,
135
150
it returns the <type>string</type> that describes the current options.
136
151
</para>
137
152
</refsect1>
138
153

154
+
<refsect1 role="changelog">
155
+
&reftitle.changelog;
156
+
<informaltable>
157
+
<tgroup cols="2">
158
+
<thead>
159
+
<row>
160
+
<entry>&Version;</entry>
161
+
<entry>&Description;</entry>
162
+
</row>
163
+
</thead>
164
+
<tbody>
165
+
<row>
166
+
<entry>8.0.0</entry>
167
+
<entry>
168
+
If the parameter <parameter>options</parameter> is given and not &null;, the <emphasis>previous</emphasis>
169
+
options are returned. Formerly, the <emphasis>current</emphasis> options have been returned.
170
+
</entry>
171
+
</row>
172
+
<row>
173
+
<entry>8.0.0</entry>
174
+
<entry>
175
+
<parameter>options</parameter> is nullable now.
176
+
</entry>
177
+
</row>
178
+
<row>
179
+
<entry>8.0.0</entry>
180
+
<entry>
181
+
The <literal>"e"</literal> option now throws a <classname>ValueError</classname>.
182
+
</entry>
183
+
</row>
184
+
<row>
185
+
<entry>7.1.0</entry>
186
+
<entry>
187
+
The <literal>"e"</literal> option now emits an <constant>E_DEPRECATED</constant>.
188
+
</entry>
189
+
</row>
190
+
</tbody>
191
+
</tgroup>
192
+
</informaltable>
193
+
</refsect1>
194
+

139
195
<refsect1 role="seealso">
140
196
&reftitle.seealso;
141
197
<para>
...
...
@@ -148,7 +204,6 @@
148
204
</refsect1>
149
205

150
206
</refentry>
151
-

152
207
<!-- Keep this comment at the end of the file
153
208
Local variables:
154
209
mode: sgml
155
210