1

If my string is:

mary lamb The beast the castle THE large lake

I want to produce:

mary lamb
The beast
the castle
The large lake

If I do (?i)(?:(.*the)) then it only splits on the last the but i want to split on each "the" regardless of case.

ggorlen
  • 44,755
  • 7
  • 76
  • 106
BobsBugs
  • 11
  • 2

2 Answers2

0

You need to use

(?i)(?=\bthe\b)
(?i)\s+(?=\bthe\b)

See the regex demo. Details:

  • (?i) - case insensitive modifier
  • \s+ - one or more whitespaces
  • (?=\bthe\b) - a positive lookahead that matches a location immediately followed with the as a whole word.
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
0

An alternative to RegEx:

  1. Do a formula to replace "the" with CHR(13)+"the"

  2. Do a simpler Text to Columns, with \n for the delimiter and splitting to rows.

johnjps111
  • 1,160
  • 9
  • 24