I need to detect words as 'bot/hersen/levermetastase' and transform them into 'botmetastase, hersenmetastase, levermetastase'. But also 'lever/botmetastase' into 'levermetastase, botmetastase'.
So I need to be sure the "word/word/word metastase" is as variabele as possible in numbers.
This is my solution but it doesn't work.
FILTERIN:
\b(\w)\s*[\/]\s*(\w)\s*(metastase)\b
FILTEROUT:
$1metastase, $2metastase, $3metastase
You may use
Replace with
$1metastase(with space at the end).If there can be spaces around the slashes, use
where
\hmatches a horizontal only whitespace char, and\swill match any whitespace char.See the regex demo #1 and regex demo #2.
Details
/?- an optional/char(\w+)- Group 1: one or more word chars(?=(?:/\w+)+metastase\b)- that must be followed with(?:/\w+)+- one or more occurrences of/and then 1+ word charsmetastase\b- andmetastasewhole word (\bis a word boundary)/?- an optional/char.