FoxTrot Search Forum - RDF feed
type: channel
description: FoxTrot Search for macOS Forum
items: Is there a limit to how long regex expression can be?
items: Re: Is there a limit to how long regex expression can be?

Is there a limit to how long regex expression can be?
type: item
description: I have a list of files and folders that I want to filter for, and I usually search for them by using regex expressions to filter by path name. For example, I might search for something with a logic like "files with the characters 9000 or 8000 or 7000 in the file path". Of course, I have a long list of files and folders that I want to search for so the regex can grow very long. Is there a known limit on how long a regex expression can be for Foxtrot? I understand I could also achieve the same effect by creating a separate Foxtrot database instead of filtering by path names, but it's not possible for me to programmatically add new files to a Foxtrot database, whereas I can programmatically add files to an ordinary database like MySQL, query against it, and generate a regex from its outputs. I understand this is a niche problem that few experience, so even a simple "yes" or "no" answer would be very helpful for me. Thank you for your considerations.
creator: Atlas
date: 2022-04-24T10:21:12-00:00

Re: Is there a limit to how long regex expression can be?
type: item
description: I don't think there is an arbitrary limit on the length of a regular expression in FoxTrot itself. The regular expression engine we use, PCRE2, has some limits, but "they will never in practice be relevant". See pcre2limits.
creator: FoxTrot Engineering
date: 2022-04-25T06:52:45-00:00