Use of regular expressions in macOS search fields

Solution 1:

I don't know if you discovered this already but you just need to click on the magnifying glass in the search field, it has a little down-pointing caret which is the clue, see this screenshot:

enter image description here

After clicking choose Insert Pattern and you get a range of options:

This is basically user-friendly regex, i.e. you get tokens you can easily arrange into quite powerful search patterns.

enter image description here

The example in the screenshot is TextEdit however this option doesn't appear to be available in Preview.

Solution 2:

This Apple Support article on how to Narrow your search results on Mac is the most detailed documentation I have been able to find on Finder searches. While the OP is mainly asking about regular expression searches in Preview, the question title brought me here looking for the same information for Finder searches.

The last section on boolean operators (Search using AND, OR, and NOT) is relevant also for Preview, although their utility for text search is rather questionable. Regular expressions are not mentioned, so I suppose these are not supported in the macOS search fields.