Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

mb_regex_set_options

Description

Set/Get the default options for mbregex functions

Syntax

mb_regex_set_options(
    ?string $options = null
): string

Parameters

options

The options to set. This is a string where each character is an option. To set a mode, the mode character must be the last one set, however there can only be set one mode but multiple options.

OptionDescription
iAmbiguity match on
xEnables extended pattern form
m'.' matches with newlines
s'^' -> '\A', '$' -> '\Z'
pSame as both the m and s options
lFinds longest matches
nIgnores empty matches
ModeDescription
jJava (Sun java.util.regex)
uGNU regex
ggrep
cEmacs
rRuby
zPerl
bPOSIX Basic regex
dPOSIX Extended regex

Return

The previous options. If options is omitted or null, it returns the string that describes the current options.

Examples

1 · void

<?

$return = mb_regex_set_options();

echo $return;

?>
pr

2 · options · i

<?

$options = 'i';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
ir

3 · options · x

<?

$options = 'x';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
xr

4 · options · m

<?

$options = 'm';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
mr

5 · options · s

<?

$options = 's';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
sr

6 · options · p

<?

$options = 'p';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
pr

7 · options · l

<?

$options = 'l';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
lr

8 · options · n

<?

$options = 'n';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
nr

9 · options · mode · j

<?

$options = 'j';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
j

10 · options · mode · u

<?

$options = 'u';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
u

11 · options · mode · g

<?

$options = 'g';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
g

12 · options · mode · c

<?

$options = 'c';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
c

13 · options · mode · r

<?

$options = 'r';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
r

14 · options · mode · z

<?

$options = 'z';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
z

15 · options · mode · b

<?

$options = 'b';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
b

16 · options · mode · d

<?

$options = 'd';

mb_regex_set_options($options);

$return = mb_regex_set_options();

echo $return;

?>
d
HomeMenu