Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 582

jq split string by a pattern

$
0
0

I have a json object with one of field having values for example "countries-sapi-1.0", "inventory-list-api-1.0-snapshot"

Note that the first one has sapi and the other one has api.

Using jq, how can i get countries-sapi or inventory-list-api I mean whatever is there before the version. the version can be as simple as 1.0 or 1.0.1-snapshot etc..


Viewing all articles
Browse latest Browse all 582

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>