Hi guys,

I have a situation where I need to use in an examples table values containing 
backslash characters.
Because somehow the backslash(es) are disappearing from the textual data what 
arrives to logic, I made a debug and checked the user mailing list.

Indeed first of all I need the backslashes for simulating newline character, as 
other user asked,
but I didn’t found any entry regarding the \ and $ characters as that would 
solve my problem.

During the debug I found, that the main cause is the String.replaceAll(regex, 
replacement) at ExamplesTable#replaceNamedParameters(Map<String, String> row)
used at line 339 at version 3.9.3 as:

replacedValue = replacedValue.replaceAll(namedKey, namedValue);

I don’t know, how widely is used the regex advanced functionality (grouping) 
when declaring named parameters and they values (with or without examples 
table),
but if is not,  changing the above line to

replacedValue = replacedValue.replaceAll(namedKey, 
java.util.regex.Matcher.quoteReplacement(namedValue));

would help some people.

Thanks in advance for your comments.

Best Regards,

Szabolcs Rugina
Java Developer

Reply via email to