{"path":"/sutl/examples/path-wildcards","content":{"title":"Selecting values with wildcards","summary":"A worked sUTL example with source data, transform, expected output and runnable-original links.","body":"[sUTL](/sutl) · [Guide](/sutl/guide) · [Reference](/sutl/reference) · [Examples](/sutl/examples)\n\nThis worked example preserves its recovered source, transform and expected result. It is a static, inspectable example in Everything.\n\n## Source\n\n```json\n{\n  \"name\": \"people list\",\n  \"people\": [\n    {\n      \"name\": \"Fred\",\n      \"title\": \"Mr\"\n    },\n    {\n      \"name\": \"George\",\n      \"title\": \"Rev\"\n    },\n    {\n      \"name\": \"Harriet\",\n      \"title\": \"Dr\"\n    }\n  ]\n}\n```\n\n## Transform\n\n```json\n{\n  \"names\": \"&@.people.*.name\",\n  \"allnames\": \"&@.**.name\",\n  \"people\": \"&@.people.*\",\n  \"alsopeople\": \"^@.people\",\n  \"a person\": \"^@.people.*\",\n  \"allmypaths\": \"&~.*\"\n}\n```\n\n## Expected result\n\n```json\n{\n  \"names\": [\n    \"Fred\",\n    \"George\",\n    \"Harriet\"\n  ],\n  \"allnames\": [\n    \"people list\",\n    \"Fred\",\n    \"George\",\n    \"Harriet\"\n  ],\n  \"people\": [\n    {\n      \"name\": \"Fred\",\n      \"title\": \"Mr\"\n    },\n    {\n      \"name\": \"George\",\n      \"title\": \"Rev\"\n    },\n    {\n      \"name\": \"Harriet\",\n      \"title\": \"Dr\"\n    }\n  ],\n  \"alsopeople\": [\n    {\n      \"name\": \"Fred\",\n      \"title\": \"Mr\"\n    },\n    {\n      \"name\": \"George\",\n      \"title\": \"Rev\"\n    },\n    {\n      \"name\": \"Harriet\",\n      \"title\": \"Dr\"\n    }\n  ],\n  \"a person\": {\n    \"name\": \"Fred\",\n    \"title\": \"Mr\"\n  },\n  \"allmypaths\": [\n    \"&@.people.*.name\",\n    \"&@.**.name\",\n    \"&@.people.*\",\n    \"^@.people\",\n    \"^@.people.*\",\n    \"&~.*\"\n  ]\n}\n```\n\n## Run it\n\nUse the [language site example](https://sutl-bronzearch.house-of-ur.com/examples/path-wildcards-sutllang-emlynoregan-com--7b3ef5d8-7bd6-9b08-35c3-9e6c76ee7032/) or copy it into the [playground](https://sutl-bronzearch.house-of-ur.com/playground/). If the transform calls `map_core` or another library name, load the [core distribution](/sutl/core-library) and compile its requirements; the full fixture retains that library context.\n\n[Full original fixture](https://github.com/emlynoregan/sutl-language/blob/0c3463677495ea00767f8266ae900eb4e2f98617/fixtures/studio/7b3ef5d8-7bd6-9b08-35c3-9e6c76ee7032.json) · [Curated source record](https://github.com/emlynoregan/sutllang-site/blob/e59ecafd364848cd71a1d18ce74cdf67f2f69328/content/examples/curated/path-wildcards-sutllang-emlynoregan-com--7b3ef5d8-7bd6-9b08-35c3-9e6c76ee7032.json)\n\n## Related reading\n\n[Paths](/sutl/guide/paths) · [Quoting and evaluation](/sutl/guide/quoting-and-evaluation) · [Libraries](/sutl/guide/declarations-and-libraries)\n\n## Source\n\nAdapted from [the sUTL source material](https://github.com/emlynoregan/sutllang-site/blob/e59ecafd364848cd71a1d18ce74cdf67f2f69328/content/examples/curated/path-wildcards-sutllang-emlynoregan-com--7b3ef5d8-7bd6-9b08-35c3-9e6c76ee7032.json).\n\n[Back to sUTL](/sutl) · [Software & Agents](/topics/software-and-agents) · [All topics](/guide)","author":"Emlyn O'Regan"}}