Class RegExp

java.lang.Object
com.google.gwt.regexp.shared.RegExp

public class RegExp extends Object
A class for regular expressions with features like Javascript's RegExp, plus Javascript String's replace and split methods (which can take a RegExp parameter). The pure Java implementation (for server-side use) uses Java's Pattern class, unavailable under GWT. The super-sourced GWT implementation simply calls on to the native Javascript classes.

There are a few small incompatibilities between the two implementations. Java-specific constructs in the regular expression syntax (e.g. [a-zinvalid input: '&'invalid input: '&'[^bc]], (?invalid input: '<'=foo), \A, \Q) work only in the pure Java implementation, not the GWT implementation, and are not rejected by either. Also, the Javascript-specific constructs $` and $' in the replacement expression work only in the GWT implementation, not the pure Java implementation, which rejects them.