Code Monkey home page Code Monkey logo

Comments (4)

mwilliamson avatar mwilliamson commented on July 29, 2024

Could you give an example of how you'd use jq (as in the command line tool) to do what you're looking for? It seems like the program you've written would just return the string 127\. If you're trying to filter, I'd imagine you want to do something like:

jq.compile(r'select(test("127\\."))')

from jq.py.

clowe-r7 avatar clowe-r7 commented on July 29, 2024

So this would be the command line
jq '.asset_names[] | test("127\\.|10\\.|172\\.1[6-9]\\.|172\\.2[0-9]\\.|172\\.3[0-1]\\.|192\\.168\\.")' test

and test looks like this

{
"asset_names": [
"127.0.0.1",
"127.0.0.1",
"127.0.0.1",
"127.0.0.1",
"127.0.0.1"
]
}

from jq.py.

clowe-r7 avatar clowe-r7 commented on July 29, 2024

Could you give an example of how you'd use jq (as in the command line tool) to do what you're looking for? It seems like the program you've written would just return the string 127\. If you're trying to filter, I'd imagine you want to do something like:

jq.compile(r'select(test("127\\."))')

I think this is the fix. I'm testing it on a few more things now, but so far it's working

from jq.py.

clowe-r7 avatar clowe-r7 commented on July 29, 2024

That was it. Thank you!

from jq.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.