我有一個記事本文件,該文本例如:find的正則表達式的幫助和替換
*Given* I get an user ID from XXX
*And* I set header "Authorization" with value "invalid_token"
*When* I send a POST request to api/endpoint/"documentlibraryID"/"identity_id"/root/"new_name"
*Then* the response code should be 401
*And* the response should contain "Invalid authorization token"
*Given* I get an user ID from XXX
*And* I set header "Authorization" with value "YYY"
*When* I send a POST request to api/endpoint/"documentlibraryID"/"identity_id"/root/"new_name"
*Then* the response code should be 200
*And* the response should contain "new_name"
*Given* I get an user ID from "XXX"
*And* I set header "Authorization" with value "YYY"
*When* I send a POST request to api/endpoint/"documentlibraryID"/"identity_id"/root/"folder_name"?automaticRename=true
*Then* the response code should be 200
*And* the response should contain "folder_name 1"
我需要做什麼:每個字API之前,我需要插入{code:none}
和插入行末的{code}
。例如:
api/endpoint/"documentlibraryID"/"identity_id"/root/"folder_name"?automaticRename=true
將是:
{code:none}api/endpoint/"documentlibraryID"/"identity_id"/root/"folder_name"?automaticRename=true{code}
第一部分是容易的,我只更換爲{代碼:無} API API在記事本++。最後一部分是我的問題。不是所有的行都以相同的文本結束...所以我需要找到一個正則表達式,它將插入{code}
在每行的末尾,它找到單詞api某處或其他方法...不知道是否這很清楚,我可以嘗試解釋得更好,謝謝你的幫助!
你是男人,它的工作就像一個魅力!一旦它允許我將它標記爲在5分鐘內解決:-) – ryoishikawa74
非常歡迎! –