【发布时间】:2017-06-06 14:20:04
【问题描述】:
我在 Robot Framework 中使用了使用 Regexp 函数替换字符串来替换“\|”到“###PIPE###”,但它不起作用。
*** Test Cases ***
TestCast1
${result} Replace String Using Regexp Bell|fieldName|11|LastName\|dd \\\| \#\#\#PIPE\#\#\#
结果
Bell###PIPIE###fieldName###PIPIE###11###PIPIE###LastName###PIPE###dd
我的预期结果
Bell|fieldName|11|LastName###PIPE###dd
你能帮帮我吗?
【问题讨论】:
-
你能发布一个正确的输入字符串吗?
-
输入字符串 = Bell|fieldName|11|LastName\|dd 不是吗?
-
你的正则表达式函数是什么?
-
不要使用正则表达式替换固定字符串。使用普通的
Replace String替换固定字符串。
标签: python regex automation automated-tests robotframework