-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when regex_replace "\\" to "\" #150
Comments
Hi I've been taking a look into this and have been able to replicate the validation error. To help me look into what other options might be available, can you tell me more about what you are trying to achieve with your BCheck? It would be good to get a better understanding of why the backslashes need to be replaced for the check on the response and the issue to be generated. |
For example, the program will add a backslash in front of the quotation marks to escape the quotation marks entered by the user to prevent the input content from escaping from the quotation marks, but the program forgets to escape the backslash itself. Suppose there is such a response, |
We've been running a couple of tests here and investikating the behavior. If you create some variables to define the match and replace values being used in the regex_replace, you should be able to achieve what you're describing. For example if you defined the following variable:
and then used it in a regex_replace: The string stuff would be replaced by We are currently doing some further digging into a few inconsistencies we think may exist around the use of backslashes, but the above should give you a starting point. |
That's helpful, Thanks. |
Hi, i want to replace the "\\" characters to "\"(two back slash to one back slash) in response and then to do next check, but i get error when use regex_replace function,the example code like this
if "[core]" in {regex_replace({check.response.body},"\\\\","\\")} then
.i got the
Unexpected token \
error message, and i don't know what's wrong there.The text was updated successfully, but these errors were encountered: