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: user1@gmail.com user2@yahoo.com user3@gmt.org user4@gmail.com abc@xyz.com
regular_expression = ’ [^ ]@(?:(?!gmail).).[^ ]*’
replace(string, regular_expression , ‘’) --> ’ user1@gmail.com user4@gmail.com

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.

-Clayton