Hi Guys,
I am not sure if this is an intention behavior of this function but when We use it as below:
`search_append_body("^c=IN.+$", "b=AS:750");`
The result is:
`c=IN IP4 192.168.178.30b=AS:750`
What we were expecting is that the new parameter was appended in the new line like:
``` c=IN IP4 192.168.178.30 b=AS:750 ```
A workaround we have to do is:
`search_append_body("^c=IN.+$", "\r\nb=AS:750"); `
So we think it should be fix in source code since the expected behavior is always the same.
Cheers,
The ^ and $ are not part of the matched expression, but boundaries to constrain the matching.
Therefore I think the current behaviour is more intuitive for one working with regular expressions. Note that the end of string can be either \r, \n or 0x0 -- your proposal to add after the boundary constraint can mean that for other cases should be added after 0x0.
You can eventually add a new function, but the current one should stay as it is (or get new parameters to control the behaviour).
Agree that the current behaviour is correct. Maybe you want to create a function that appends a new line instead.
Thanks for your reply. You are right, having the function how it is right now is more flexible.
Closing this PR.
Regards,
Closed #882.