And here is the python code that extracts the keys from the json file, and create the regex to be put in the "find" field
(with your example, this function will print John|Paul|George|Ringo from the json file used by the regex-function. Modify the path of fname accordingly to your needs)
Code:
def get_regex():
import json
fname = '/data/temp/beastones.json'
equiv = json.load(open(fname))
if not equiv:
print(f'Problem loading {fname}')
return
print( '|'.join(equiv.keys()))
I leave to you the function that creates the json file from your original text file ; if you know a little about python, with those examples or some searches in the net, it should be easy (use the method json.dump to create the json file from the python dict)