Regex Split not Working

Hi guys,

I have data that look like this:

Sentence. Some text 9 some text. Another Sentence.
Sentence. Some text 12 some text. Another Sentence.
Sentence. Some text 1 some text. Another Sentence.
Sentence. Some text 2 some text. Another Sentence.
Sentence. Some text 3 some text. Another Sentence.

So, I am trying to extract the numbers with Regex Split using pattern:

\d

However, it is not extracting the numbers for me.

Not sure whether the splitter is the most appropriate tool for that. One simple solution: Go for the String Manipulation node and do sth. like regexReplace($string$, "[^0-9]*", "") (strips everything which is not a number character)

[edit] Alternative RegEx for use with the splitter: [^\d]*(\d*).* (semantics a little different: strip away anything which is not a number from the beginning, match consecutive number characters, and after that strip away the rest)

– Philipp

Thanks!

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