[Python] filter number from a string using jmespath

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

  1. Stack

    Stack Membro Participativo

    I have a dictionary {files: {'file':'file-121.json', 'file': 'file-100.json', 'file': 'file-101.json'}} I need to search the file, for the number after file- and check if it is in the range of 101 to 200. Here file has number 121, 100, 101. my final output file names should be file-121.json file-101.json

    i have a requirement to use only jmespath.search

    Prefix is always constant it contains only file- and ends with .json only please help me with filtering the filenames with number range using jmespath. I have more file names so

    Continue reading...

Compartilhe esta Página