Complex regular expressions can be created and tested in the Zabbix frontend by going to Administration → General → Regular expressions.
After a regular expression has been created, it can be used everywhere regular expressions are supported by referring to it's name, prefixed with **@*, for example, @mycustomregexp*.
All regular expressions in Zabbix, whether created with the advanced editor, or entered manually, support POSIX extended regular expressions.