Are the regular Java and Groovy engines the same?
Now I am doing regex based code in Groovy. But for building and testing my regexes, I use the Java regex engine reference books http://www.regexplanet.com/advanced/java/index.html .
And I'm a little scared - is Groovy's regex engine really the same as Java's one? I know they are very close. But do they have any differences? If you know the answer - can you kindly give me a link to this topic?
source to share
From the language documentation :
The template operator (~) provides an easy way to create an instance
java.util.regex.Pattern
.
I can't find an expression where the documentation guarantees that it is a regular expression engine used for pattern matching throughout Groovy; However, I find it very difficult, very, very unlikely that Groovy will use two RE engines in its implementation, or switch the RE engine in the future.
source to share
"Since Groovy is Java based, you can use the Java regex package with Groovy. Just type import java.util.regex. * At the top of your Groovy source code. Any Java code using regex will automatically work in your Groovy code. . " Source: regular-expressions.info
source to share