How Long Can a Search Regex Be?
May 26, 2023
1 min read
There is not a maximum length for individual parameters of a search query; rather, your entire query must be at most 4094 characters.
📣As of 1 March 2024, the Enrich Layer Search API no longer supports regex, instead we've switched to Boolean search.Check out the announcement post here.But this is itself still a great guide about regex.There is not a maximum length for individual parameters of a search query; rather, there is a maximum length for the entire query. This length is 4094 characters. You may allocate the characters between the fields any way you like, so the fewer parameters you have, and the shorter most of them are, the longer one single regex can be.
To give you a visual idea, here's a query that's about as long as it's allowed to be. Any longer, and it would fail.
`import json, os, requests
api_ = requests.get(company_endpoint, print(json.dumps(response.json())) `