For this purpose, the relatively new subroutine feature of PCRE may come in handy:
Code:
/((?:[^\w\s]|_)+)p(?1)e(?1)n(?1)i(?1)s(?1)/Si