Gives the below JSON:
{
"environments": [
{"env": "dev", "description": "dev environment"},
{"env": "dev01", "description": "dev01 environment"},
{"env": "dev01b", "description": "dev01 blue environment"},
{"env": "dev01g", "description": "dev01 green environment"}
]
}
I'm only interested in extracting dev01b and dev01g. Any environment with a digit followed by a letter.
In this case dev01b, dev01g.
I tried contains and ends_with functions and I was able to extract the required strings.
But, the number of environments keep increasing and I need to extract all these environment names with digit followed by letter in the end. And it is not sustainable to add ends_with function for all combinations of letters and digit.
I want to add some regex kind of grammar in the ends_with function and extract all the values.
Is it possible with JMESPath?
By the way, I'm using aws cli --query.
jqor write a Python script instead that usesboto3to call AWS and do the filtering in Python code.'dev01g'[5]to be equal togavg(@)orcontains(@, 'menu').61in hexadecimal (hence thex) is the characterain the ASCII table, the character7Ais thez; that's all. Ref: en.wikipedia.org/wiki/ASCII#Character_set