mb_eregi

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

mb_eregiComparación de expresiones regulares ignorando mayúsculas/minúsculas con soporte multibyte

Descripción

mb_eregi(string $pattern, string $string, array &$regs = ?): int

Ejecuta la comparación de expresiones regulares insensible a mayúsculas/minúsculas con soporte multibyte.

Parámetros

pattern

El patrón de la expresión regular.

string

El string donde buscar.

regs

Contiene un substring del string comparado.

Valores devueltos

Ejecuta la comparación de expresiones regulares con soporte multibyte, y devuelve 1 si se encontraron coincidencias. Si se especificó el parámetro opcional regs, la función devolverá la longitud en bytes de la parte comparada, y el array regs contendrá el substring del string comparado. La función devuelve 1 si coincide con el string vacío. Si no se encontraron coincidencias u ocurrió un error, devolverá false.

Notas

Nota:

La codificación interna o la codificación especificada por mb_regex_encoding() será usada en esta función.

Ver también

  • mb_regex_encoding() - Establecer/obtener la codificación de caracteres para expresiones regulares multibyte
  • mb_ereg() - Comparación de expresiones regulares con soporte multibyte

add a note add a note

User Contributed Notes 3 notes

up
8
bubalula at gmail dot com
13 years ago
This function does not work - it is not case insensitive for non latin characters.
up
0
steve at brainwashstudios dot com
20 years ago
When this function is perfected, and is not experimental, it may be very usefull in the searching and pinpointing of places inside large text files.
up
-7
lasmit at what dot com
12 years ago
I simulated it:
<?php
   $text
= 'Äpfel';
  
mb_internal_encoding( 'utf-8' );
  
printf( "%d\n", mb_eregi( 'äpfel', $text ) ); // Output: 0
  
printf( "%d\n", mb_ereg( 'äpfel', mb_strtolower( $text ) ) ); // Output: 1
  
printf( "%d\n", mb_eregi( 'äpfel', mb_strtolower( $text ) ) ); // Output: 1
?>
To Top