0
嗨,我有以下的正則表達式正則表達式不是在Groovy
def formula = math:min(math:round($$value1$$ * $$value2$$))
def m = formula =~ /\$\$\w+\$\$/
println m.group(1)
以上應該理想地打印$$值1 $$
現在這個表達式爲以下字符串工作正常上regex101.com但同樣正常工作在Groovy上不起作用。理想情況下,它應該使用匹配API找到兩個組$ $$ 1 $$和$$ value2 $$,但它不會。
正則表達式有什麼問題嗎?請指導。提前致謝。
嗨@collinD請我最新的編輯。 – u449355
顯示您的Groovy或Java代碼。請注意,在regex101下工作的正則表達式不必在Java中工作,因爲regex101不支持Java正則表達式語法。 –
這是Groovy,而不是Java –