This is specific to Base58. I would strongly recommend that for new protocols (e.g. new Zcash forks or shielded protocols) that bech32 or bech32m be used, rather than Base58. Those allow the prefix or “Human-Readable Part” to be specified directly.
That said, the above prefix was found as follows: append the correct number of bytes for an address to the candidate prefix, first using 0x00 bytes and then using 0xFF bytes, and encode the result as Base58. If both of those encodings start with the desired string, then the prefix is correct. (Knowledge of the order of the Base58 character set can be used to speed up the search, but it still involves some trial and error.) Note that this only works if the length of an address is fixed, as it is for Zcash transparent and Sprout addresses.