I would like to extract JSON entries from the main JSON bulk data, based on an input, in JavaScript. Each entry in the main JSON data has it's own unique ID, but the filter should be based on the text identifier rather than the ID. I would like to retrieve for example all entries that contain the word burg (Burg, BURG, bUrg, etc.) or any other given variety. This should of course also work with other search terms. I do not possess the JavaScript skills to do this.
In the data given below this should return 3 results. Obviously, the result should be the exact same JSON format.
Example JSON:
{"type":"FeatureCollection","features":[
{"id":1,"text":"Cape Town"},
{"id":2,"text":"Kimberley"},
{"id":3,"text":"Beaufort West"},
{"id":4,"text":"Johannesburg Park"},
{"id":5,"text":"Germiston"},
{"id":6,"text":"Pietermaritzburg"},
{"id":7,"text":"Durban"},
{"id":8,"text":"Bellville"},
{"id":9,"text":"Wellington"},
{"id":10,"text":"Huguenot"},
{"id":11,"text":"Worcester"},
{"id":12,"text":"Matjiesfontein"},
{"id":13,"text":"Laingsburg"},
{"id":14,"text":"Prince Albert"},
{"id":15,"text":"Hutchinson"},
{"id":16,"text":"De Aar"},
{"id":17,"text":"Warrenton"}
]}