I am using this below in a declarative groovy pipeline Jenkins template & it throws me error as unexpected token \ can anybody guide please ? Intention is to match the word in sonar.projectKey & use it further. how to achieve this? please note that when I use freestyle jobs in same jenkins using this below it works fine.
command - echo "${sonarcmd}" >> sonar.txt grep -Po 'sonar\.projectKey=\K[^ ]+' sonar.txt -- Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html