1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] re.match unexpectedly returning no results [duplicate]

Discussão em 'Python' iniciado por Stack, Setembro 14, 2024.

  1. Stack

    Stack Membro Participativo

    my string may contain the Regex pattern :\d\dfalse where the :\d\d is just the trailing end of a timestamp and I want to check that. If I find it, I will do a re.sub and change it. Example value: :57false For some reason this is not working although I can see file_content string does contain it.

    bugpatt = re.compile(r":\d\dfalse")

    if re.match(bugpatt,file_content):
    print("CANCEL REGEX FOUND dig dig colon false")
    else:
    print("WHY NO CXL BUG FOUND???")



    Any idea why this is not working?

    Continue reading...

Compartilhe esta Página