On Aug 1, 6:35 am, Brian <
hibr...@gmail.com> wrote:
> GWT compiles your java into javascript. What you will be testing and
> deploying is javascript. Java Source---GWT--->Javascript Output
>
> I take that sentence to mean that you want to make sure the pattern
> you're using in a regex is the Javascript meaning. Since your java
> source is churned into javascript by gwt, a regex string literal in
> your source code will become a regex string literal -in javascript-.
> You might expect \Q \E to work according to the Java docs, but those
> patterns aren't in Javascript's regex, so it won't work. I believe
> the warning that you use expressions in Java that have the same
> Javascript meaning is so you don't get confused looking at your source
> code expecting a certain behavior (ie, the \Q \E above) and not seeing
> it in the running code.
...and the GWTShell executes your *Java* code, so the regexps have to
be Java-regexp-compatible for your app to work in Hosted Mode.
In a few words:
- if you use JavaScript-only regexp constructs, your app will fail in
Hosted Mode, so developping and debugging will become a pain
- if you use Java-only regexp constructs, your app will run in Hosted
Mode but will fail in "web mode"
So you should base your developments on the JavaScript regexp syntax;
and if it fails in Hosted Mode, then find an alternate that's still
JavaScript-compaible and happens to also be Java-compatible. If you
base your devs on the Java regexp syntax, you'll only notice the
incompatibilities when testing in web mode, which generally happen
late in the development process...