# String Manipulation - regexReplace backslash

**URL:** <https://forum.knime.com/t/string-manipulation-regexreplace-backslash/5593>\
**Category:** KNIME Analytics Platform\
**Created:** [January 14, 2017, 9:45pm UTC](https://forum.knime.com/t/string-manipulation-regexreplace-backslash/5593 "2017-01-14T21:45:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamleshpatel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/97f17d/32.png) [@kamleshpatel](https://forum.knime.com/u/kamleshpatel)\
**Post date:** [January 14, 2017, 9:45pm UTC](https://forum.knime.com/t/string-manipulation-regexreplace-backslash/5593/1 "2017-01-14T21:45:20Z")

</div>

I am trying use regexReplace function in String Manipulation to replace backslash at the end of the string. I can do it in perl node but the amount data that I have it takes forever to execute. Can any on help me?

Thanks,

-Kam

---

<div class="post-metadata">

**Author:** ![kamleshpatel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/97f17d/32.png) [@kamleshpatel](https://forum.knime.com/u/kamleshpatel)\
**Post date:** [January 14, 2017, 10:02pm UTC](https://forum.knime.com/t/string-manipulation-regexreplace-backslash/5593/2 "2017-01-14T22:02:19Z")

</div>

I think this works for me. I any one has better idea please let me know.&nbsp;

regexReplace($column$, "(/|\\\\)$" "")

&nbsp;

Thanks,

-Kam

---

<div class="post-metadata">

**Author:** ![Willem](https://forum-cdn.knime.com/user_avatar/forum.knime.com/willem/32/73426_2.png) [@Willem](https://forum.knime.com/u/Willem)\
**Post date:** [January 16, 2017, 8:36am UTC](https://forum.knime.com/t/string-manipulation-regexreplace-backslash/5593/3 "2017-01-16T08:36:14Z")

</div>

You could use a "String Replacer" with a Regular expression:&nbsp;^(.\*)(\\)$ and then replace whole string with $1

This will remove backslash if it is the last character in the string value.

I've attached image file of the configuration settings.

- [remove\_-\_backslash\_at\_end.png](https://www.knime.com/sites/default/files/remove_-_backslash_at_end.png)

---

<div class="post-metadata">

**Author:** ![kamleshpatel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/97f17d/32.png) [@kamleshpatel](https://forum.knime.com/u/kamleshpatel)\
**Post date:** [January 16, 2017, 9:29pm UTC](https://forum.knime.com/t/string-manipulation-regexreplace-backslash/5593/4 "2017-01-16T21:29:50Z")

</div>

Didn't think about that. I appreciate&nbsp;your help.

Thanks,

Kamlesh

&nbsp;

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:22pm UTC](https://forum.knime.com/t/string-manipulation-regexreplace-backslash/5593/5 "2023-06-23T20:22:07Z")

</div>


