2015-10-20 43 views
1

我想基於條件正則表達式匹配運行詹金斯生成步驟,我無法弄清楚它爲什麼不匹配。詹金斯有條件運行步驟不匹配

這裏是它的外觀在詹金斯: enter image description here

我使用正則表達式:.*iOS.對構建參數,pmt_content。

這裏的pmt_content值:

<body><pre>^1234567890^abc123def132afd1213afas^iOS^Test User^[email protected]^iPad 3^</pre><img src='https://cirrus.app47.com/notifications/5626a0bc9ac25b6ea7003f2f/img' alt=''/></body> 

這裏的控制檯日誌告訴我,它不匹配。

[PollMailboxTrigger] An email matching the filter criteria was found. (log) 
Building in workspace /Users/jenkins/.jenkins/jobs/New Device Listener/workspace 
Run condition [Regular expression match] enabling prebuild for step [Execute shell] 
Regular expression run condition: Expression=[.*iOS.*], Label=[ 
<body><pre>^1234567890^abc123def132afd1213afas^iOS^Test User^[email protected]^iPad 3^</pre><img src='https://cirrus.app47.com/notifications/5626a0bc9ac25b6ea7003f2f/img' alt=''/></body>] 
Run condition [Regular expression match] preventing perform for step [Execute shell] 
Finished: SUCCESS 

顯然pmt_content包含「iOS」。

我在www.regexplanet.com上測試了相同的值。

我在做什麼錯?

回答

1

由於我的標籤數據中的換行符會阻止匹配,所以我遇到了類似的挫折。很難從您的轉儲中知道,如果在開始時可能會出現換行符。無論如何,你可以嘗試(?is).*iOS.*Reference