Golf a regex that matches syntactically valid programs in the language of your choice. 1: Pick a programming language, P, that meets these requirements: P is known to be Turing-Complete. P has a freely available and working compiler or interpreter. 2: Create a regular expression, R, such that: R matches any string that is a syntactically valid program of P. R rejects any string that…