Build origin search regexps server-side.
Motivations:
- Makes behavior of the API closer to what we will have when it will use swh-search
- A step toward not accepting arbitrary regexps from the network.
- Less code (itertools.permutations instead of our own JS implementation)
- More tests.
Depends on !213 (closed).
Migrated from D2387 (view on Phabricator)