Forum Discussion
Zdenek_Moravec
Oct 27, 2024Brass Contributor
How to extract multiple occurrences of a text enclosed between two same characters
Dear colleagues, I have a cell with plenty of text. Some part of the text is enclosed between tags >> and <<. The task is to extract all these strings to one cell, separated by new line. Notes ...
- Oct 28, 2024
I hope this works for you (with the text in A5):
=LET(w, TEXTSPLIT(A5, "!"), n, COUNTA(w), s, SEQUENCE(, n), f, FILTER(w, ISEVEN(s)), TEXTJOIN(CHAR(10), TRUE, f))
PeterBartholomew1
Oct 27, 2024Silver Contributor
A start might be
= TEXTJOIN(
CHAR(10),,
REGEXEXTRACT(targetString, ">[\w|\s]*(?=<)", 1)
)
Zdenek_Moravec
Oct 28, 2024Brass Contributor
Regular expressions is a topic for next sleepless nights, once the functions come to M365 Basic 😉 I will notice Your solution and learn on it ...