我在记事本中有一个文件,其中包含以下文本:
*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替换为Notepad++ 中的{code:none}api。最后一部分是我的问题。并非所有行都以相同的文本结尾......所以我需要找到一个正则表达式,它会{code}
在每行的末尾插入它在某处找到单词api或其他方法......不确定这是否清楚,我可以尝试更好地解释,感谢您的帮助!