# String Manipulation using RegEx

**URL:** <https://forum.knime.com/t/string-manipulation-using-regex/14485>\
**Category:** KNIME Analytics Platform\
**Tags:** regex\
**Created:** [March 22, 2019, 3:48pm UTC](https://forum.knime.com/t/string-manipulation-using-regex/14485 "2019-03-22T15:48:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reykas92](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@Reykas92](https://forum.knime.com/u/Reykas92)\
**Post date:** [March 22, 2019, 3:48pm UTC](https://forum.knime.com/t/string-manipulation-using-regex/14485/1 "2019-03-22T15:48:01Z")

</div>

**Greetings, fellow KNIME-Community!**

For severel days now I’ve been trying to solve a certain issue regarding Data Extraction from an existing xlsx-File, but I cannot manage to accomplish any good results.

**What I am trying to do:**  
I downloaded a huge amount of CVs/Resumes as PDF-Files, converted them into TXT-Files and saved the output in an XLSX-File, where the whole Information is stored in **one** cell of the Excelsheet.

The resumes are either written in German or English language. My goal is to extract certain Information that matter to me from those Cells, e.g. **Applicants’ nationality** , **Universal Degree** , **Language Skills in German** etc. and to put those information into a new column in the respective sheet.

**What my problem is:**  
If I simply filter the data after setting up a Rule Engine via certain keywords like “german, indian, english, etc…” like this:  
 ![grafik](https://forum-cdn.knime.com/uploads/default/original/2X/d/dc6e4c87a06cb4df458ffb5af4fe37d23e053c66.png)

the given rule will also apply to data strings in the respective cell that do not contain any information about the applicants nationality but instead about other things like _learning german language_ or _hanging out with german people_. The result is obviously, that people might get wrong attributions.

**What I tried to solve the problem:**  
After experimenting a day or two with Rule Engines, I was thinking about using Regular Expressions instead. To do so, I tried to set up a “String Manipulation-Node” that uses a RegEx which searches for two specific terms in a range of 10 or less words to each other. This is the RegEx-Command i found working on [regex101.com](http://regex101.com) in terms of the given example in the first image:  
indisch\W+(?:\w+\W+){0,10}?Nationalität|Nationalität\W+(?:\w+\W+){0,10}?indisch

it worked flawlessly…

however, if I try to use the same Regular Expression in the String Manipulation Node like this:  
regexReplace($CV anonymised$,“indisch\W+(?:\w+\W+){0,10}?Nationalität|Nationalität\W+(?:\w+\W+){0,10}?indisch”,“indisch”)

the output in the newly appended column stays the same.

Does anyone know why? Or can somebody help me out with another way to solve the problem?

I would gladly appreciate your help, and thank you all in advance!

Kind Regards,  
Reykas

---

<div class="post-metadata">

**Author:** ![quaeler](https://forum-cdn.knime.com/user_avatar/forum.knime.com/quaeler/32/3944_2.png) [@quaeler](https://forum.knime.com/u/quaeler)\
**Post date:** [March 22, 2019, 5:07pm UTC](https://forum.knime.com/t/string-manipulation-using-regex/14485/2 "2019-03-22T17:07:56Z")

</div>

The regex does a match against an entire string. For example with the target string “weltschmerz”, the query regex (in the KNIME nodes using regex) “schmerz” will not match, but, for example “[^s]+schmerz” will match.

---

<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:** [April 2, 2019, 11:36am UTC](https://forum.knime.com/t/string-manipulation-using-regex/14485/3 "2019-04-02T11:36:57Z")

</div>

Closed on April 2, 2019, 11:36am UTC

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