mb_regex_set_options
Description
The mb_regex_set_options of Multibyte String for PHP 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.
Option | Description |
---|---|
i | Ambiguity match on |
x | Enables extended pattern form |
m | '.' matches with newlines |
s | '^' -> '\A', '$' -> '\Z' |
p | Same as both the m and s options |
l | Finds longest matches |
n | Ignores empty matches |
Mode | Description |
---|---|
j | Java (Sun java.util.regex) |
u | GNU regex |
g | grep |
c | Emacs |
r | Ruby |
z | Perl |
b | POSIX Basic regex |
d | POSIX 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
Links
Multibyte String
- mb_check_encoding
- mb_chr
- mb_convert_case
- mb_convert_encoding
- mb_convert_kana
- mb_convert_variables
- mb_decode_mimeheader
- mb_decode_numericentity
- mb_detect_encoding
- mb_detect_order
- mb_encode_mimeheader
- mb_encode_numericentity
- mb_encoding_aliases
- mb_ereg
- mb_ereg_match
- mb_ereg_replace
- mb_ereg_replace_callback
- mb_ereg_search
- mb_ereg_search_getpos
- mb_ereg_search_getregs
- mb_ereg_search_init
- mb_ereg_search_pos
- mb_ereg_search_regs
- mb_ereg_search_setpos
- mb_eregi
- mb_eregi_replace
- mb_get_info
- mb_http_input
- mb_http_output
- mb_internal_encoding
- mb_language
- mb_list_encodings
- mb_ord
- mb_output_handler
- mb_parse_str
- mb_preferred_mime_name
- mb_regex_encoding
- mb_scrub
- mb_send_mail
- mb_split
- mb_str_pad
- mb_str_split
- mb_strcut
- mb_strimwidth
- mb_stripos
- mb_stristr
- mb_strlen
- mb_strpos
- mb_strrchr
- mb_strrichr
- mb_strripos
- mb_strrpos
- mb_strstr
- mb_strtolower
- mb_strtoupper
- mb_strwidth
- mb_substitute_character
- mb_substr
- mb_substr_count