Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

129
Visualizações
número de anticipación de php de expresiones regulares

apiladores!

He estado tratando de resolver esto durante algún tiempo, pero sin suerte.
(.*?(?:\.|\?|!))(?: |$)

el patrón anterior captura y divide todas las oraciones en un párrafo con puntuación final.
ejemplo

  1. Hoy es el más grande. Eres el mejor.

El partido vuelve con tres

 Match { 1. Today is the greatest. You are the greatest. }

Sin embargo, estoy tratando de que no se rompa cuando hay un número con un punto y me gustaría ver la siguiente coincidencia en su lugar:

 Match { 1.Today is the greatest. You are the greatest. }

gracias por tu ayuda de antemano

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Usar

 .*?[.?!](?=(?<!\d\.)\s+|\s*$)

Ver prueba de expresiones regulares .

EXPLICACIÓN

 -------------------------------------------------------------------------------- .*? any character except \n (0 or more times (matching the least amount possible)) -------------------------------------------------------------------------------- [.?!] any character of: '.', '?', '!' -------------------------------------------------------------------------------- (?= look ahead to see if there is: -------------------------------------------------------------------------------- (?<! look behind to see if there is not: -------------------------------------------------------------------------------- \d digits (0-9) -------------------------------------------------------------------------------- \. '.' -------------------------------------------------------------------------------- ) end of look-behind -------------------------------------------------------------------------------- \s+ whitespace (\n, \r, \t, \f, and " ") (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- | OR -------------------------------------------------------------------------------- \s* whitespace (\n, \r, \t, \f, and " ") (0 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- $ before an optional \n, and the end of the string -------------------------------------------------------------------------------- ) end of look-ahead
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda