[Bug] String Replacer appends replacement two times

Hi there,

this is bugging me for quite a while and seems to have went unnoticed. When using a String Replacer with wildcard RegEx but NOT using a “^” to mark the beginning of the line, the replacement is added two times.

System: macOS X Catalina 10.15.7
Knime: Most recent
Plugings:

KNIME Amazon Cloud Connectors 4.2.0.v202006171540 org.knime.features.cloud.aws.feature.group KNIME AG, Zurich, Switzerland
KNIME Analytics Platform 4.2.3.v202011031551 org.knime.desktop.product null
KNIME BigQuery 4.2.0.v202007101231 org.knime.features.database.extensions.bigquery.feature.group KNIME AG, Zurich, Switzerland
KNIME Connectors for Common Databases 4.2.0.v202006221532 org.knime.features.dbdrivers.feature.group KNIME AG, Zurich, Switzerland
KNIME Database 4.2.1.v202008251536 org.knime.features.database.feature.group KNIME AG, Zurich, Switzerland
KNIME Ensemble Learning Wrappers 4.2.0.v202004061016 org.knime.features.ensembles.feature.group KNIME AG, Zurich, Switzerland
KNIME Excel Support 4.2.1.v202008251158 org.knime.features.ext.poi.feature.group KNIME AG, Zurich, Switzerland
KNIME Expressions 4.2.2.v202009241054 org.knime.features.expressions.feature.group KNIME AG, Zurich, Switzerland
KNIME Extension providing the Chromium Browser 83.0.4103.116 org.knime.features.ext.chromium.feature.group KNIME AG, Zurich, Switzerland
KNIME File Handling Testing Framework 4.2.3.v202011021201 org.knime.features.filehandling.core.testing.feature.group KNIME AG, Zurich, Switzerland
KNIME Google Cloud Storage Connection 4.2.2.v202009241054 org.knime.features.google.cloud.storage.feature.group KNIME AG, Zurich, Switzerland
KNIME Google Connectors 4.2.2.v202009241054 org.knime.features.google.api.feature.group KNIME AG, Zurich, Switzerland
KNIME Image Processing 1.8.3.202010230604 org.knime.knip.feature.feature.group University of Konstanz / KNIME
KNIME JavaScript Views 4.2.3.v202011021201 org.knime.features.js.views.feature.group KNIME AG, Zurich, Switzerland
KNIME Javasnippet 4.2.0.v202006150933 org.knime.features.javasnippet.feature.group KNIME AG, Zurich, Switzerland
KNIME JSON-Processing 4.2.1.v202008251158 org.knime.features.json.feature.group KNIME AG, Zurich, Switzerland
KNIME Math Expression (JEP) 4.2.2.v202009241054 org.knime.features.ext.jep.feature.group KNIME AG, Zurich, Switzerland
KNIME Personal Productivity Tools 4.2.0.v202001210919 org.knime.features.personalproductivity.feature.group KNIME AG, Zurich, Switzerland
KNIME Plotly 4.2.0.v202006071334 org.knime.features.js.plotly.feature.group KNIME AG, Zurich, Switzerland
KNIME Public Server Access 4.2.3.v202011021202 com.knime.features.enterprise.client.exampleserver.feature.group KNIME AG, Zurich, Switzerland
KNIME Quick Forms 4.2.3.v202011021201 org.knime.features.js.quickforms.feature.group KNIME AG, Zurich, Switzerland
KNIME REST Client Extension 4.2.0.v202006301416 org.knime.features.rest.feature.group KNIME AG, Zurich, Switzerland
KNIME ServerSpace 4.11.3.v202011021202 com.knime.features.explorer.serverspace.feature.group KNIME AG, Zurich, Switzerland
KNIME Statistics Nodes 4.2.0.v202008251159 org.knime.features.stats.feature.group KNIME AG, Zurich, Switzerland
KNIME SVG Support 4.2.2.v202009241055 org.knime.features.ext.svg.feature.group KNIME AG, Zurich, Switzerland
KNIME Testing Framework 4.2.0.v202006171549 org.knime.features.testing.core.feature.group KNIME AG, Zurich, Switzerland
KNIME Testing Framework - JavaScript support 4.2.1.v202008251343 org.knime.features.testing.js.feature.group null
KNIME Testing Framework UI 4.2.1.v202008251158 org.knime.features.testing.application.feature.group KNIME AG, Zurich, Switzerland
KNIME Timeseries nodes 4.2.0.v202003271454 org.knime.features.timeseries.feature.group KNIME AG, Zurich, Switzerland
KNIME Virtual Nodes 4.2.0.v202004271350 org.knime.features.virtual.feature.group KNIME AG, Zurich, Switzerland
KNIME XML-Processing 4.2.1.v202008251159 org.knime.features.xml.feature.group KNIME AG, Zurich, Switzerland
Lhasa public plugin 1.1.500.v202007031132 org.lhasalimited.knime.public.feature.feature.group Lhasa Limited (http://www.lhasalimited.org)
Palladian for KNIME 2.3.0.202009251618 ws.palladian.nodes.feature.feature.group palladian.ws; Philipp Katz, Klemens Muthmann, David Urbansky
Vernalis KNIME Nodes 1.27.2.v202010191232 com.vernalis.knime.feature.feature.group Vernalis Research Ltd, Cambridge, UK

Best
Mike

This is how regular expressions with * as quantifier behave: .* matches twice, once for the complete string and then for the empty string at the end. You can debug this behavior nicely at https://regex101.com/.

1 Like

Hi @thor,

sounds logical but also counter intuitive as this RegEx virtually matches all characters. Haven‘t seen such a behavior anywhere else but in Knime to be honest which makes me wonder if common behavior, even though it might not be accurate, is still the „default“. WDYT?

Best
Mike

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.