Search pattern input components
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
We have a few places that require the user to enter a search pattern. From a small review of settings pages, the 2 search patterns we ask for currently are regular expressions or glob-style wildcard patterns.
Click to view screenshots of existing search pattern inputs
Internal users email regex - /admin/application_settings#js-visibility-settings
Protected branches (and tags) - /:namespace/:project/settings/repository#js-protected-branches-settings
Webooks push event - /:namespace/:project/settings/integrations
Test coverage parsing - /settings/ci_cd
These search pattern inputs can sometimes be confusing to users with little experience and for more complex cases can be confusing for those with plenty experience. This is true for regular expressions moreso than globs and true for globs moreso than the simple asterisk-only argument expansion we're using for protected refs.
I think UX could come up with a great way to unify search pattern components that will allow us to be consistent in how we display the input and its supplementary information. I also think we could do more to help make these settings a little friendlier. We could add a "test pattern" feature that allows the user to test their intended targets against their pattern.
Click to view an example of the "test pattern" feature
IMO, Google Optimize does this well for its URL targeting feature. (the screenshot doesn't show it, but you can use a regex) In our cases we can probably have something a little more compact, but I think it explains my point well.
Of course, I don't think we should be creating anything that allows someone to do something that they have no understanding of at all as this could be detrimental, but we can help those that are sure they want to make a change.



