I am writing an android app that takes as an input a .txt file about 25 pages. I want to split this text to four parts using custom delimiters. For example let's say I want to split the text in the place where the phrase is. I have tried using
file.split("[<BUILDING rid="1">]")
and StringTokenizer st = new StringTokenizer(file, "\\b<BUILDING rid="1">\\b");
and StringTokenizer st = new StringTokenizer(file, "[<BUILDING rid=\"1\">]");
and many more but I cannot find a way to create custom delimiters using regex and I split my text in wrong places. Can anybody help me?