[Python] How to write find-all function (with regex) in awk or sed

Discussão em 'Python' iniciado por Stack, Maio 31, 2025.

  1. Stack

    Stack Membro Participativo

    I have bash function which run python (which return all found regex from stdin)

    function find-all() {
    python -c "import re
    import sys
    print '\n'.join(re.findall('$1', sys.stdin.read()))"
    }


    When I use this regex find-all 'href="([^"]*)"' < index.html it should return first group from the regex (value of href attribute from file index.html)

    How can I write this in sed or awk?

    Continue reading...

Compartilhe esta Página