@regexp vs @trigram

I haven’t seen @regexp or @trigram directive in GraphQL.

It’s @search(by: [regexp])!

Regular expressions require the trigram index. A trigram is a substring of 3 consecutive characters, or runes.
The trigrams of trigram are: tri, rig, igr, gra and ram.

Refer: Regular Expressions | Search | Dgraph Tour

TL;DR: Trigram is an indexing technique that allows Regular expression searches to work on strings. See documentation for String Search.