Regular expression negation

Does the CommCare replace() function support negation of regular expressions? The negative lookahead syntax (?!) returns an error (regular expression is invalid).

Example: filter a string to return only gmail addresses:
string = ‘Emails:
regular_expression = ’ [^ ]@(?:(?!gmail).).[^ ]*’
replace(string, regular_expression , ‘’) --> ’

For somewhat historical reasons the regular expressions engine used by CommCare is Apache Jakarta.

The documentation for that library should have more information about what regex grammar is supported.