我如何能够对Groovy中的字符串中的两个不同单词进行regex?确实,我只能在找到一个字符串时才能使用它。 def r = "This is a line that only contains LookForMe and nothing else"
def result = r =~ ('LookForMe' || 'AndMeToo')
assert result instanceof M
我通过XmlParser检查后写入一些文本。 所有工作正常,但代码,不要关闭该文件,那么我在程序中有问题后者。它创建.tmp文件。那个动作结束后我的文件有多接近? def path = new File("my/path"))
def xml = new XmlParser().parse(path)
xml.appendNode("include", [
myApp