You have already linked to a comparison table between XML- and ECMAScript-Style regexes, so you could easily figure out the differences.
There are some relevant differences:
\d
and \w
only match ASCII digits/alphanumerics in JavaScript (and Java).
- JavaScript doesn't support Unicode character properties (
\p{L}
etc.) like XML and Java do.
- Neither Java nor JavaScript support XML character escapes (like
\i
and \c
) or character class subtraction ([a-z-[aeiou]]
).
So if your XML regexes were to use any of those features, you wouldn't be able to convert them easily.
You can fix at least part of the problem by using Steve Levithan's XRegExp package with Unicode plug-ins to fix the Unicode issues. And in Java 7, you can switch on Unicode matching for \d
and \w
, so that should cover most of your potential issues.
However, there may be subtle implementation differences that aren't so obvious, so you'd definitely need to do some testing.