Codigo Regex cumpliendo 2 condiciones

Buenas tardes agradeciendoel apoyo que puedan brindarme
Como puedo obtener 1 match dentro de un texto cumpliendo 2 condiciones:

  • la primera que la linea tenga la fecha de hoy “date.now”
  • la segunda que encuentra la palabra “Examined”

Este es el codigo que tengo hasta el momento pero no me funciona alguna idea?
^(?=.\b09/12/2021\b)(?=.\b Examined\b).*$

ejemplo del texto:
07/12/2021 12:21:34 Files Examined : 05
08/12/2021 12:21:34 Files Examined : 05
09/12/2021 12:21:34 Files Examined : 05
07/12/2021 12:21:34 Files Completed : 05
08/12/2021 12:21:34 Files Completed : 05
09/12/2021 12:21:34 Files Completed : 01
09/12/2021 12:21:34 Files Failed : 0
09/12/2021 12:21:34 Files Deduplicated : 0

gracias de antemano.

Hi,

How about the following pattern?

(?<=09/12/2021.*?Examined : ).*

or

Regards,

Hi @josue.martinez

Steps to be followed

  1. First separate the the lines which has Examined
    regex101: build, test, and debug regex
  2. Loop through lines And get the date from the lines
    regex101: build, test, and debug regex
  3. If the line contains the Current date get the no of files Examined
    regex101: build, test, and debug regex

Hope this Helps

Regards
Sudharsan

1 Like